Debian 7.5

My VirtualHost for port 80 works fine with the ifmodule for fastcgi. However, it does not work with the VirtualHost for port 443.

SSL/https:// was working fine until I added the following:

<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization

When I try to restart Apache I get an error:

Reloading web server config: apache2 failed!

However, if I remove the FastCgiExternalServer line, it works.


In you SSL definition, add this

Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgiSSL
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgiSSL -socket /var/run/php5-fpm.sock -pass-header Authorization

The error you had was due to the double definition of the alias

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

By creating an alias with another name (in this case php5-fcgiSSL), your issue is solved


You can connect to FastCGI either via a port or a socket.

In the offending line:

FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock

You are connecting via socket. Replace -socket with -host, e.g. -host

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.