Installing PHP-FPM with Apache2 on Ubuntu 12.10

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.

I have placed this in /etc/apache2/sites-available/default and restarted Apache via sudo service apache2 restart to no avail.

<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 </IfModule>

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!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Hello there,

As Ubuntu 12.04 is been quite outdated for a while I’ll leave a link for our tutorial on How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 22.04


ok, that means your PHP is not functioning… <br> <br>do you have this line in your site server config: fastcgi_pass unix:/var/run/php5-fpm.sock; <br> <br>you need to be sure the php-fpm is running. you can run this command to verify that: <br> <br>/etc/init.d/php5-fpm reload

OK <br> <br>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?)