文章來源:http://dan.drydog.com/apache2php.html


  1. 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
    You only need the enable-so line above. For information on other options, type ./configure --help and see "Compiling and Installing" in the Apache 2 Documentation, http://httpd.apache.org/

  2. Make Apache from the just-created Makefile:
    make
  3. If make is successful, install Apache as root:
    make install
  4. Download/unpack PHP source from the PHP website, http://www.php.net/
    Pick the latest from the 4.x series or 5.x series.

  5. 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
    You only need the --with-apxs2, and prefix lines. --with-mysql adds MySql, --with-config-file moves the php.ini file location, disable-cgi disables the CGI version, which is not needed if you use Apache modules. It also enables and installs the command line interface (CLI) version. --with-zlib allows use of gzip-type compression, --with-gettext is for internationalization, and --with-gdbm allows access to GDBM databases. For more information, type ./configure --help and see the "Installation" chapter in the PHP Manual, http://ww.php.net/docs.php

  6. Make PHP from the just-created Makefile:
    make
  7. If make is successful, type this as root to install PHP:
    make install
    If you are not root (I do not perform makes while root, for security and safety reasons), become root and type the following:
    make install-su
  8. 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
  9. Install the php.ini file:
    cp -p php.ini-recommended /usr/local/apache/php/php.ini




arrow
arrow
    全站熱搜

    付爸爸 發表在 痞客邦 留言(0) 人氣()