I have been having problem installing php-fpm for use with apache2-mpm-worker. This is the guide that I am following.

According to the guide's Step 5,

Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host -pass-header Authorization

However I cannot find php5-fcgi at /usr/lib, but only /usr/bin/php5-cgi and /usr/bin/php-cgi, which I am not sure if they are the same.

So I changed the lines in Step 5 to:

Alias /php5-fcgi /usr/bin/php5-fcgi
FastCgiExternalServer /usr/bin/php5-fcgi -host -pass-header

On restarting Apache, it's logs gave the errors:

[notice] caught SIGTERM, shutting down
[alert] (4)Interrupted system call: FastCGI: read() from pipe failed (0)
[alert] (4)Interrupted system call: FastCGI: the PM is shutting down, Apache seems to have disappeared - bye
[notice] Apache/2.2.22 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 configured -- resuming normal operations
[notice] FastCGI: process manager initialized (pid 16348)

And on loading the index page

[error] [client] (111)Connection refused: FastCGI: failed to connect to server "/usr/bin/php5-cgi": connect() failed
[error] [client] FastCGI: incomplete headers (0 bytes) received from server "/usr/bin/php5-cgi"
[error] [client] File does not exist: /var/www/mydomain/public/favicon.ico

Question: Any idea why php5-fcgi is missing, and how should this problem be fixed? Thank you!! :)

  • Were you able to get this resolved? – daemonofchaos Oct 16 '12 at 19:06
  • Unfortunately I did not. I switched to nginx and managed to get php-fpm to work. I will revisit this issue again with Apache, sorry for the delay! – Nyxynyx Oct 16 '12 at 19:37

You should set it back to

Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi

It doesn't exist because the next line intercepts the call and forwards it to the fpm

FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
  • Great. In my case, the vhost config file is generated by ISPCONFIG, and I had to change FastCgiExternalServer ALIAS_NAME -host ... to FastCgiExternalServer ALIAS_NAME -socket /var/run/php5-fpm.sock to get it working. Still don't know why it was not generated correctly ?! – Kojo Dec 17 '14 at 19:08
  • 1
    The -socket part did the trick in my case (Ubuntu 12.04, upgraded PHP from standard 5.3 to 5.5). – Paolo Stefan Feb 27 '15 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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