文章來源:http://dan.drydog.com/apache2php.html
- In the Apache 2 source directory, create a Makefile by typing:
./configure --prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-info \
--enable-rewrite \
--enable-speling \
--enable-usertrack \
--enable-deflate \
--enable-ssl \
--enable-mime-magic
- Make Apache from the just-created Makefile:
make
- If make is successful, install Apache as root:
make install
- Download/unpack PHP source from the PHP website, http://www.php.net/
Pick the latest from the 4.x series or 5.x series.
- In the PHP source directory, create a Makefile by typing:
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext \
--with-gdbm
- Make PHP from the just-created Makefile:
make
- If make is successful, type this as root to install PHP:
make install
make install-su
- If file /usr/local/apache/modules/libphp5.so does not exist or is an older version, type this (change this to libphp4.so for PHP 4):
cp -p .libs/libphp5.so /usr/local/apache/modules
- Install the php.ini file:
cp -p php.ini-recommended /usr/local/apache/php/php.ini
全站熱搜