Question

How to setup PHP to run as FastCGI with Apache?

  • Posted December 11, 2013

I have a Ubuntu 12.04 LTS droplet running a LAMP stack right now which is nearly a clean install with the exception of a few virtual hosts.

I want to setup PHP to run as FastCGI, but I cannot for the life of me find some easy to follow instructions to do so.

As I understand it, this requires some configuration in the Apache .conf, and/or virtual hosts blocks, as well as probably installing some additional modules.

On another VPS using Plesk control panel, this can be changed for each domain with a single option.

Now that I’m flying solo, I’m stuck here.

Any help is MUCH appreciated!

Subscribe
Share

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

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.

facing same problem. ubuntu 16.4 need to use php fast_cgi but I can’t make it work. any sugestion. PHP 7.0 ubuntu 16.6 apache2

can this be applied to a centOS box?

@htpcbeginner: What problems are you hitting?

None of these worked for me on Ubuntu 14.04 server. Any help? Thanks.

Thanks Pablo! This is what I’ve been looking for. <br> <br>Now when I check the phpinfo() I can see that the Server API is FPM/FastCGI. Hooray!

These look great! thanks for the quick reply. I’ll give these a try and let you know what happens!

Check out <a href=“http://www.failover.co/blog/quick-setup-apache-worker-fastcgi-php-fpm-and-apc”>Quick Setup: Apache Worker, FastCGI, PHP-FPM and APC</a> and/or <a href=“http://www.howtoforge.com/using-php5-fpm-with-apache2-on-ubuntu-12.04-lts”>Using PHP5-FPM With Apache2 On Ubuntu 12.04 LTS</a>.