To install PHP to operate with Apache, compile it as an Apache module.
Configure Apache so that it recognizes shared modules using the following steps.
Configure Apache to recognize shared modules.
Execute commands similar to the following from the directory where your Apache files were extracted:
$ cd Apache-source-directory $ ./configure --enabled-shared=max --enable-module=most --prefix=/Apache-installation-directory
The following example is for Apache version 2.2.9. You must change apache_2.2.9 to the version of Apache you are using.
$ cd ~/apache_2.2.9 $ ./configure --enabled-shared=max --enable-module=most --prefix=/usr/local/web/apache
Recompile and install the relevant components:
$ make $ make install
Now you are ready to compile PHP to operate as an Apache module.
PHP is successfully compiled as a shared module.