How to Compile Apache and PHP

PHP can be compiled as a shared module of a web server (such as Apache) or as a CGI executable. If you are using a web server that is not supported by PHP, or to execute PHP scripts in a command shell rather than on a web page, you should compile PHP as a CGI executable. Otherwise, to install PHP to operate with Apache, compile it as an Apache module.