2007-03-10
■[環境構築]さくらインターネットにSmarty

インストールされているwgetでは、うまくソースをダウンロードできなかったので、
PCにダウンロードしてからFTPで$HOME/local/srcに上げておいた。
php.iniにinclude_pathを設定し、Smartyを使えるようにする。
これでSmarty自身は動いたけど、ローカルではPHP5で作ってたので
どないなることやら。。。
■[環境構築]さくらインターネットにPHP5.2.1

上記に書いたみたいに、これはアプリにかなりの変更が必要になるので
いっそのことPHP5を使えるようにしてみる。
ここをたよりに
インストールしてみる。
# wget http://jp.php.net/get/php-5.2.1.tar.gz/from/this/mirror
configureを実施する。
./configure \
- prefix=$HOME \
- with-config-file-path=$HOME/www/php5.ini \
- program-suffix=5 \
- with-pear=$HOME/share/pear5 \
- enable-force-cgi-redirect \
- enable-mbstring=all \
- enable-mbregex \
- enable-mbstr-enc-trans \
- enable-versioning \
- enable-trans-sid \
- with-mysql \
- with-openssl=/usr \
- with-soap=yes \
- with-zlib=/usr \
- with-gd=/usr/local \
- with-jpeg-dir=/usr \
- with-freetype-dir=/usr \
- with-ttf \
- with-png-dir=/usr \
- with-curl
あとはmake, make installするだけやねんけども
make installで問題発生。。。
Installing PEAR environment: /home/xxx/lib/php/
could not extract the package.xml file from "phar://install-pear-nozlib.phar/Console_Getopt-1.2.tar" Error while opening {/tmp/pear/cache/package.xml} in write binary mode
[PEAR] Console_Getopt: Cannot initialize 'phar://install-pear-nozlib.phar/Console_Getopt-1.2.tar', invalid or missing package file
could not extract the package.xml file from "phar://install-pear-nozlib.phar/Archive_Tar-1.3.2.tar" Error while opening {/tmp/pear/cache/package.xml} in write binary mode
[PEAR] Archive_Tar: Cannot initialize 'phar://install-pear-nozlib.phar/Archive_Tar-1.3.2.tar', invalid or missing package file
could not extract the package.xml file from "phar://install-pear-nozlib.phar/PEAR-1.4.11.tar" Error while opening {/tmp/pear/cache/package2.xml} in write binary mode
[PEAR] PEAR: Cannot initialize 'phar://install-pear-nozlib.phar/PEAR-1.4.11.tar', invalid or missing package file
Installing PDO headers: /home/xxx/include/php/ext/pdo/
なんでやねん、、、どっこもこんなつまづき書いてへんやん。。。
みんなうまいこといったって書いてるやん。。。
色々と調べてみるとPHP5.2.0から、PEARの環境変数を設定しやんかったら
デフォルトで/tmpを使おうとするらしいので、
vi $HOME/.cshrc
もう一回、make install。
OK、うまいこといった!!!
あとは、cgiとして起動させる設定を実施して
Action php5-script /cgi-bin/php5.cgi
AddHandler php5-script .php
OK!動いた!!!
ただし、$HOME/www/php5.iniに設定した設定ファイルを
ちゃんと読んでくれない。。。
phpinfo()にはちゃんと$HOME/www/php5.iniって出てるねんけど、
設定しても、まったく反映されず。。。
include_pathがSmartyで使用するのに使うねんけど、
ちなみにデフォルトの場所はconfigureで設定した
$HOME/share/pear5になってた。
これの調査はおいおい。。。
とりあえず、全部PHP5で動いた!!!
何か久しぶりの達成感やな。。。。