php 5.2.3 のインストールログ 1. 展開 gtar zxvf php-5.2.3.tar.gz 2. configure と make pgsql を使い、ビルトインの gd を有効にして作成 cd php-5.2.3 ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --enable-mbstring --enable-mbregex --with-libxml-dir=/usr/local/lib --with-pgsql=/usr/local/pgsql --with-mysql=/usr/local/mysql --includedir=/usr/local/include (apache の dynamic module として作成。libxml2 の新しいバージョンが 必要だそうなのでそれもインストールしておく。今回は libxml2-2.6.29。 readline-5.2 も入れたが、/opt/sfw に入ってるものを使えばよかったかも。) (ZLIB を使ってくれないので、/usr/local 以下の zlib-1.2.3 を入れ、 --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/local/lib --with-tiff-dir=/usr/lib --with-xpm-dir=/usr/lib とかしてみたがダメであった。jpeg,png,tiff,xpm は標準で大丈夫そう。) make make install 3. 設定 cp php.ini-dist /usr/local/lib/php.ini php.ini の編集 output_buffering = On output_handler = mb_output_handler register_globals = On include_path = ".:/php/includes:/usr/local/lib/php" mbstring.language = Japanese mbstring.internal_encoding = EUC-JP mbstring.http_input = auto mbstring.http_output = SJIS mbstring.detect_order = auto mbstring.substitute_character = ?; httpd.conf の編集 LoadModule php5_module modules/libphp5.so <- これは自動的に追加される AddType application/x-httpd-php .php .php4 を加えておく。 という内容のファイル phpinfo.php を 適当なところに置いて表示してみる。 4. 後からの注: 別マシンに同様の構成でインストールを試みたところ、 -------------------------------------------------- Undefined first referenced symbol in file mysql_set_character_set ext/mysql/.libs/php_mysql.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php collect2: ld returned 1 exit status *** Error code 1 -------------------------------------------------- のようなエラーが出る。原因不明だったが、このマシンでは ./configure に --with-openssl をつけていた点が異なった。いろいろ調べてみて、 http://www.mail-archive.com/php-install@lists.php.net/msg15339.html の記述に基づいて --with-openssl を --with-openssl=/usr/local/ssl の ように変更すると問題なくなった。