Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 test.dev 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
        </Files>
    </Directory>
</IfModule>


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

1 Answer 1

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

 
discard

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.