Skip to content

Instantly share code, notes, and snippets.

@kolunar
Created April 24, 2017 22:53
Show Gist options
  • Save kolunar/bdef45f9e7c23b197ea6aeac50ce7c5b to your computer and use it in GitHub Desktop.
Save kolunar/bdef45f9e7c23b197ea6aeac50ce7c5b to your computer and use it in GitHub Desktop.
installing php5-fpm on Ubuntu Server 14.04 TLS LAMP stack
Assuming that you're starting with a basic LAMP stack, first you need to install the needed packages:
sudo apt-get install libapache2-mod-fastcgi php5-fpm
Then create the file "/etc/apache2/conf-available/php5-fpm.conf" with the contents:
<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>
Then enable the new mods and config:
a2enmod actions fastcgi alias
a2enconf php5-fpm
service apache2 reload
You should be up and running. To verify, create a file called "/var/www/html/info.php" with the contents:
<?php
phpinfo();
?>
You may also need to switch from the apache MPM non-threaded module mpm_prefork to a threaded one.
a2dismod mpm_prefork
then
a2enmod mpm_worker
or
a2enmod mpm_event
If it's not installed:
apt-get install apache2-mpm-worker
or
apt-get install apache2-mpm-event
ref:https://www.digitalocean.com/community/questions/apache-2-4-with-php5-fpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment