Installing PHP and Apache
10 Nov 2004As part of the work Geoff and I are doing with Apache-Test, I wrote some instructions for installing PHP and Apache with my favorite options.
To install PHP as a shared library:
$ tar -xvzf apache_1.3.33.tar.gz$ tar -xvzf php-5.0.2.tar.gz$ cd apache_1.3.33$ ./configure \--prefix=/usr/local/apache \--enable-module=most \--enable-shared=max$ make$ sudo make install$ cd ../php-5.0.2$ ./configure \--prefix=/usr/local/php \--with-apxs=/usr/local/apache/bin/apxs \--with-gd \--with-mysql=/usr/local/mysql \--enable-sockets \--with-zlib-dir=/usr/include$ make$ sudo make install
To install PHP as a static library:
$ tar -xvzf apache_1.3.33.tar.gz$ tar -xvzf php-5.0.2.tar.gz$ cd apache_1.3.33$ ./configure$ cd ../php-5.0.2$ ./configure \--prefix=/usr/local/php \--with-apache=../apache_1.3.33 \--with-gd \--with-mysql=/usr/local/mysql \--enable-sockets \--with-zlib-dir=/usr/include$ make$ sudo make install$ cd ../apache_1.3.33$ ./configure \--prefix=/usr/local/apache \--activate-module=src/modules/php5/libphp5.a \--enable-module=most \--enable-shared=max$ make$ sudo make install
If you're planning to attend ApacheCon, you don't want to miss our talk, Testing PHP with Perl. It will (hopefully) change the way you develop PHP applications.