I am trying to setup PHP-FPM on my Ubuntu 12.10 server, but I just cannot seem to get the scripts to execute. I am following instructions as per [this tutorial](http://www.versatilewebsolutions.com/blog/2012/11/installing-apache-2-with-php-fastcgi-on-ubuntu-12-10.html). I have placed this in `/etc/apache2/sites-available/default` and restarted Apache via `sudo service apache2 restart` to no avail. ` 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 ` As I've read, PHP-FPM is more commonly used with NGINX, but I would love any help in getting this up and running on my LAMP setup!
edited by jmarhee

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers
An autofill changed the title of this post and I can't seem to edit it. The original title was: 'Installing PHP-FPM with Apache2 on Ubuntu 12.10'
check these:


Hi, I've tried following this, but I keep getting the error:

(111)Connection refused: FastCGI: failed to connect to server "/usr/lib/cgi-bin/php5-fcgi": connect() failed

Even though my apache2.conf (also tried in a vhost or default conf in sites-available) contains

Alias /php5.fastcgi /var/www/fastcgi/php5.fastcgi
FastCGIExternalServer /var/www/fastcgi/php5.fastcgi -socket /var/run/php-fpm.sock

Not quite sure what I'm doing wrong at this point? I've also seen different discussion about running socket vs over IP ( between Apache 2.4 and 2.2?

I realised that the config in the tutorial was using the wrong socket in the Apache config, so I've fixed that, but now the PHP code is simply being displayed as text (and not executing as PHP?)
ok, that means your PHP is not functioning...

do you have this line in your site server config: fastcgi_pass unix:/var/run/php5-fpm.sock;

you need to be sure the php-fpm is running. you can run this command to verify that:

/etc/init.d/php5-fpm reload