Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to setup php-fpm with apache

I am still missing a piece of the puzzle, because the page returns a 404

The requested URL /php-fpm/index.php was not found on this server.

Apache/2.2.24 (Unix) DAV/2 mod_fastcgi/2.4.6 Server at Port 80

From what I understand sofar is that the path mentioned in the alias does not have to exist, but it should match with the following ExternalServer directive. The socket path is exactly the same as has been set in the php-fpm config. I chmodded -R 777 the var and the tmp directory and the site directory. I saw that the socket and the fastcgi have the same owners "_www", those are the default settings and saw no need to change them.

php54 --with-php-fpm, mod_fastcgi are installed with Homebrew, but this guide did not help me either

What else can I do? Any suggestions very much appreciated.

this is what is in my httpd

<IfModule mod_fastcgi.c>
 #   <FilesMatch \.php$>
   #     SetHandler php-script
 #   </FilesMatch>
 #   Action php-script /php.external
#    Alias   /php.external   /var/run/mod_fastcgi/php.fpm
AddHandler php-fastcgi .php
Action php-fastcgi /php-fpm
 Alias   /php-fpm   /var/run/mod_fastcgi/php.fpm

    FastCGIExternalServer /var/run/mod_fastcgi/php.fpm -socket /tmp/php-fpm.sock -idle-timeout 900 -pass-header Authorization
    AddType application/x-httpd-fastphp5 .php
    DirectoryIndex index.php index.shtml index.cgi index.html index.htm
    Options +Indexes +FollowSymLinks +ExecCGI +Includes +MultiViews
    <Directory "/var/run/mod_fastcgi/">
        Order deny,allow
        Deny from all
        <Files "php.fpm">
            Order allow,deny
            Allow from all

<VirtualHost *>  
    DocumentRoot "/Users/redres/Webdev/testsite/public"  
  <Location /php-fpm>
              Order Deny,Allow
              Deny from all
              Allow from env=REDIRECT_STATUS
share|improve this question

I struggled with Apache 2.2 and PHP-FPM for days, until I realized that it didn't work unless FastCgiWrapper was set to Off. Not sure if this makes any difference for you, but it fixed my problems. Be aware that any FastCgi scripts executed by Apache will not run through suexec after this. PHP-FPM does not need this, but you may have other FastCgi instances running.

share|improve this answer
It might be usefull if I could find the directive? – Richard Oct 15 '13 at 13:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.