2
votes

I had apache and php5 already installed and wanted to switch to fpm-php. I performed the following steps and my phpinfo() still shows that the Server API is Apache 2.0 Handler! I am running ubuntu 12.04 Can someone help me out

Steps taken to the install;

  1. apt-get install libapache2-mod-fastcgi php5-fpm php5
  2. a2enmod actions fastcgi alias
  3. service apache2 restart
  4. Edited etc/apache2/conf.d/php5-fpm.conf

    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 /tmp/php5-fpm.sock -pass-header Authorization

  5. edited /etc/php5/fpm/pool.d/www.conf

    listen = /tmp/php5-fpm.sock

  6. service php5-fpm restart service apache2 restart

I tried with

<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 -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>`

and

listen = 127.0.0.1:9000

no luck.

2
I think you have to use apache2-mpm-worker with external external php, but this is not the reason for your problem here - are you sure you have removed / disabled the mod_php configuration?Michel Feldheim
That was it. I had not disabled mod_php! Thanks!John Hamman

2 Answers

1
votes

This might be of some assistance for you. This is my working configuration for setting up Apache w/FPM Support.

https://gist.github.com/3849349

My current setup is using Apache 2.4.x. To make it work with Apache 2.2 it would only require minimal changes with the Apache config itself. However, all FPM settings will work in either version.

If you want to strike up a conversation you'll always find me in the FreeNode IRC channel #php-fpm as Diemuzi

-1
votes

Thanks to @John Hamman I solved it by running:

a2dismod php5
service apache2 restart

Cheers guys..finally