apache 和 lighttpd 的 PHP 共存?


基本上這是我個人的設定資料..

  1. Lighttpd 主要使用 –enable-fastcgi –enable-force-cgi-redirect
  2. Apache 主要則是 –with-apxs2=/usr/local/apache-2.0.63/bin/apxs (這是自己的路徑)
1
./configure --prefix=/usr/local/php5-fastcgi --enable-mbstring --enable-pcntl --with-mysql=/usr/local/mysql50 --enable-fastcgi --enable-force-cgi-redirect --with-gd=/usr/local/modules/gd --with-zlib --with-png-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-freetype-dir=/usr/local/modules/freetype --with-iconv=/usr/local/lib --enable-gd-native-ttf --enable-dbase --enable-exif --enable-ftp --enable-sqlite-utf8 --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --with-curl --with-openssl --with-apxs2=/usr/local/apache-2.0.63/bin/apxs

此外, Apache 還需要加入

1
2
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

並在下面的位置加入 index.php

1
DirectoryIndex index.php