Differences between revisions 2 and 3
Revision 2 as of 2013-05-10 14:43:48
Size: 1191
Editor: thumbs
Revision 3 as of 2014-03-15 00:05:52
Size: 1189
Editor: thumbs
Comment: Fix curly quotes
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
  `<Directory /var/www/fcgi/">`<<BR>>   `<Directory "/var/www/fcgi/">`<<BR>>

The scope of this article is to discuss the possible configurations with Apache httpd 2.2 and php. Using mod_php in most cases is not a viable solution, since it introduces scalability issues with the added RAM requirement for each httpd process. Additionally, it precludes the use of threaded MPMs since php extensions are not thread-safe in many cases.

The ideal configuration is a light threaded httpd process that communicates with an external fastcgi server, such as PHP-FPM.

The first recipe uses mod_fastcgi:

  • Alias /php5.fcgi /var/www/fcgi/php5.fcgi
    FastCGIExternalServer /var/www/fcgi/php5.fcgi -flush -host

    # Invent a new handler name and use it for PHP files
    AddHandler my-fastcgi .php

    # Requests for *.php are actually fed to php-fastcgi as an argument
    Action my-fastcgi /php5.fcgi

    <Directory "/var/www/fcgi/">
      Order deny,allow
      Deny from all
      <Files "php5.fcgi">
        Order allow,deny
        Allow from all

Thanks to Guillaume Seigneuret for the kickstart on that recipe!

php-fastcgi (last edited 2014-03-15 00:05:52 by thumbs)