Running PHP on Apache httpd

The scope of this document is to enumerate all possible configuration scenarios to allow httpd to serve php content.

Using proxy_fcgi and php-fpm (for 2.4)

This method is preferred above all other recipes, and is suitable for versions 2.4 and newer. It also allows for a threaded mpm such as event or worker, which will significantly reduce the RAM requirements on your server.

Please see the following article

Using php with fastcgi (for 2.2 and older)

This method is suitable for versions 2.2 and older. It allows for a threaded mpm such as worker, which will significantly reduce the RAM requirements on your server.

Please see the following article

Using php with fcgid (for 2.2 and older)

This method is suitable for versions 2.0 or 2.2. It allows for a threaded mpm such as worker, which will significantly reduce the RAM requirements on your server. And mod_fcgid is an official Apache module.

Please see the following article

Using php as a DSO (deprecated)

This method is the oldest and slowest possible configuration. It is suitable for version 2.2 and older, and requires the use of the prefork mpm.

First, the module must be loaded:

Then, add the handler for the dso:

References:

Official php installation and configuration instructions

Common issues:

Why is my php file offered as a download with mod_php?

php (last edited 2013-06-03 19:48:45 by gryzor)