fastCGI用のPHPインストール

Lighttpd

lighttpdでPHPを利用するためにはfastCGI APIを使ってlighttpdから呼ばれる。
それに対応したPHPのバイナリを作る。

apxs対応のモジュールの作成とは同時にできない。

% wget http://jp2.php.net/get/php-5.2.8.tar.gz/from/this/mirror
% tar zxf php-5.2.8.tar.gz
% cd php-5.2.8
% ./configure   --enable-fastcgi --enable-force-cgi-redirect --enable-discard-path --enable-mbstring --enable-soap --enable-zend-multibyte --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-curl --with-curlwrappers --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-mcrypt --with-bz2 --enable-zip --with-mysqli
% make
# sudo cp sapi/cgi/php-cgi /usr/local/bin/php-cgi

lighttpd.confにPHPの設定が書いてあるから、コメントアウトを外す。
以下に該当部分を記載する。

fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/var/run/lighttpd/php-fastcgi.socket",
                                   "bin-path" => "/usr/local/bin/php-cgi"
                                 )
                               )
                            )

コメント