WEB開発のあれこれ
PHP,JAVA,Javascript,objective-c,Ajax,Flex,Air,Linuxなどなど
最近雑記帳になりつつある・・・
2011.10.23より忍者ブログより移転
2008年9月18日木曜日
2008年9月17日水曜日
[PHP] phpをコマンドラインから使う
phpをコマンドラインで使う方法
処理バッチとしては使った事があったけど、Cやperlみたく標準入力から対話型のプログラムも作れるみたい
http://www.spencernetwork.org/memo/tips-6.php
処理バッチとしては使った事があったけど、Cやperlみたく標準入力から対話型のプログラムも作れるみたい
http://www.spencernetwork.org/memo/tips-6.php
2008年9月11日木曜日
mb_send_mailのCC、BCC設定
$header .= "
From: 送信元
Cc: CCのメールアドレス
Bcc: BCCのメールアドレス
";
/* メール送信 */
mb_send_mail($email, $subject, $body, "$header");
http://lab.z-nix.jp/2005/12/mb_send_mail_ccbcc.html
2008年9月7日日曜日
PHPインストール
やってきましたPHPインストールw
最新版の5.2.6をオフィシャルからダウンロードして展開
展開したフォルダにcdして
'./configure' '--prefix=/usr/local/php5' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-curl' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-openssl' '--with-png' '--with-jpeg' '--with-regex=system' '--with-xml' '--with-xsl' '--with-xmlrpc=shared' '--with-pcre' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql=/usr/local/mysql' '--enable-soap' '--enable-spl' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-discard-path' '--with-ttf' '--enable-xslt' '--enable-zend-multibyte' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-libjpeg-dir=/usr' '--enable-so' '--enable-gd-imgstrttf' '--with-jpeg-dir=usr/lib' '--with-freetype-dir=/usr'
いつもながら長っ!w
libxml2が無いよーと怒られるので
apt-get install libxml2-dev
opensslが無いよーと若干本気で切れられるので
apt-get install libssl-dev
bzip2が無いよーと半ば投げやりに呆れられるので
apt-get install libbz2-dev
ここからMDB関連のエラーでにっちもさっちもいかん状態に:;
↓に解決法があります。
libjpeg libpng libfreetype6 libgmp3 libxslt1
それぞれのdevを求められるので、これもaptでインストールしておく
で
make
rootにsuして
make install
↓DBA(QDBM)エラーの解決法
やっと対応策が判明したので追記
configure: error: DBA: Could not find necessary header file(s).
このエラーでコンパイル停止してしまう。
原因?と思われるものが書いてあるページ(英語)
http://bugs.php.net/bug.php?id=31585&edit=1
どうもQDBMのエラーと思っていたがGDBMのdevelが無いのが原因らしい
��色々試した結果)
やった事
結局以上の事をしたが、おそらく必要だったのは以下のパッケージ
libgdbm-dev
tdb-dev
debianだからだろうか・・・
こんなエラー実務では見たことなかった。
ってかこれだけエラー内容が不明瞭でわかりずりーっつーの
09/04/26現在最新の5.2.9のコンパイルオプションは以下
'./configure' '--prefix=/usr/local/php5' '--with-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-curl' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-openssl' '--with-png-dir=/usr/lib' '--with-regex=system' '--with-xml-dir=/usr' '--with-xsl' '--with-xmlrpc=shared' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql=/usr/local/mysql' '--enable-soap' '--enable-spl' '--enable-shmop' '--enable-calendar' '--enable-mbstring' '--enable-discard-path' '--with-ttf' ' '--enable-zend-multibyte' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-gd-native-ttf '--with-jpeg-dir=usr/lib' '--with-freetype-dir=/usr' '--with-pgsql=/usr/local/pgsql'
postgresをPHPから操作する場合は
/etc/ld.so.conf
に
/usr/local/pgsql/lib
を追記しておく。
※これをやっていないとapacheの起動でコケる
WEB鯖を立ち上げる時のインストールの順番は以下
・Apache
・(qmail)
・MySQL or Postgres
・PHP
最新版の5.2.6をオフィシャルからダウンロードして展開
展開したフォルダにcdして
'./configure' '--prefix=/usr/local/php5' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-curl' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-openssl' '--with-png' '--with-jpeg' '--with-regex=system' '--with-xml' '--with-xsl' '--with-xmlrpc=shared' '--with-pcre' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql=/usr/local/mysql' '--enable-soap' '--enable-spl' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-discard-path' '--with-ttf' '--enable-xslt' '--enable-zend-multibyte' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-libjpeg-dir=/usr' '--enable-so' '--enable-gd-imgstrttf' '--with-jpeg-dir=usr/lib' '--with-freetype-dir=/usr'
いつもながら長っ!w
libxml2が無いよーと怒られるので
apt-get install libxml2-dev
opensslが無いよーと若干本気で切れられるので
apt-get install libssl-dev
bzip2が無いよーと半ば投げやりに呆れられるので
apt-get install libbz2-dev
ここからMDB関連のエラーでにっちもさっちもいかん状態に:;
↓に解決法があります。
libjpeg libpng libfreetype6 libgmp3 libxslt1
それぞれのdevを求められるので、これもaptでインストールしておく
で
make
rootにsuして
make install
↓DBA(QDBM)エラーの解決法
やっと対応策が判明したので追記
configure: error: DBA: Could not find necessary header file(s).
このエラーでコンパイル停止してしまう。
原因?と思われるものが書いてあるページ(英語)
http://bugs.php.net/bug.php?id=31585&edit=1
どうもQDBMのエラーと思っていたがGDBMのdevelが無いのが原因らしい
��色々試した結果)
やった事
- qdbm関連モジュールのインストール
apt-cache search qdbm
で出てきたパッケージを片っ端からインストール - Tru64関連モジュールのインストール
apt-cache search Tru64
で出てきたパッケージを片っ端からインストール - GDBM関連モジュールのインストール
apt-cache search gdbm
で出てきたパッケージを片っ端からインストール
結局以上の事をしたが、おそらく必要だったのは以下のパッケージ
libgdbm-dev
tdb-dev
debianだからだろうか・・・
こんなエラー実務では見たことなかった。
ってかこれだけエラー内容が不明瞭でわかりずりーっつーの
09/04/26現在最新の5.2.9のコンパイルオプションは以下
'./configure' '--prefix=/usr/local/php5' '--with-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-curl' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-openssl' '--with-png-dir=/usr/lib' '--with-regex=system' '--with-xml-dir=/usr' '--with-xsl' '--with-xmlrpc=shared' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql=/usr/local/mysql' '--enable-soap' '--enable-spl' '--enable-shmop' '--enable-calendar' '--enable-mbstring' '--enable-discard-path' '--with-ttf' ' '--enable-zend-multibyte' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-gd-native-ttf '--with-jpeg-dir=usr/lib' '--with-freetype-dir=/usr' '--with-pgsql=/usr/local/pgsql'
postgresをPHPから操作する場合は
/etc/ld.so.conf
に
/usr/local/pgsql/lib
を追記しておく。
※これをやっていないとapacheの起動でコケる
WEB鯖を立ち上げる時のインストールの順番は以下
・Apache
・(qmail)
・MySQL or Postgres
・PHP
2008年9月1日月曜日
vistaからsambaにアクセスできなくなる
セキュリティなどの設定をしていたら急にsambaにつながらなくなった。
色々ぐぐってみると、ローカルセキュリティポリシーの設定が必要とか出てきたが
そもそもクライアントの設定は変更してないのに、クライアントの設定を変更してもしゃーない気がして
とりあえずsambaをapt-get install sambaでアップデート
最新版は3.2.3らしいのだが、リポジトリが指したバージョンは3.0.24
まぁとりあえず入れてみるかとインストールしてみるとあっけなくアクセス成功
ぐぐった情報は1年前の記事や結構新しめの情報だったのだが、samba自体のアップデートが結構頻繁に行われているようで、時期によってはWEB上に信用できる情報が無い状態があるそうな。。
困られた方はとりあえず対象のプログラムをアップデートをお勧めします。
DDNS
DDNSで自宅サーバーを公開する。
http://www.stackasterisk.jp/tech/systemManagement/ddns01_01.jsp
外部から自宅サーバーへのアクセスができることが判明したので、変動するIPにドメインを割り振るため上記のサイトを参考にDDNSの設定を行う。
まだ導入は出来てないけど、あと少しで念願の自前のWEBサーバ公開だv
(その前にPHP位はインストールせんとねw)
後懸念材料としてsambaを導入して、そこまで見ない重要でない動画や画像ファイルを一気に移動したもんだからサーバーの容量をすでに1/4程占めてしまったw
http://www.stackasterisk.jp/tech/systemManagement/ddns01_01.jsp
外部から自宅サーバーへのアクセスができることが判明したので、変動するIPにドメインを割り振るため上記のサイトを参考にDDNSの設定を行う。
まだ導入は出来てないけど、あと少しで念願の自前のWEBサーバ公開だv
(その前にPHP位はインストールせんとねw)
後懸念材料としてsambaを導入して、そこまで見ない重要でない動画や画像ファイルを一気に移動したもんだからサーバーの容量をすでに1/4程占めてしまったw
登録:
投稿 (Atom)