finid
By:
finid

problem with php5-fpm on Nginx

January 27, 2014 19.4k views
I have php5-fpm running with nginx. Here's my problem with php5-fpm: If I try to reload/stop the daemon, I get a "reload: unknown instance" or "stop: unknown instance." But there's a php5-fpm init script. If I try to restart it, I get:
stop: Unknown instance: 
php5-fpm start/running, process 12915
Trying to start it just gives "php5-fpm start/running, process 13011." The output of "ps aux | grep -i php5-fpm" shows nothing, but "ps aux | grep -i php-fpm" shows three php-fpm processes running. Does anybody know why php5-fpm is respondsing in this fashion?
4 comments
  • Hi At some case reboot wont fix the issue at that time modify the init script which is located in /etc directory.

    This is a bug in the upstart init script in ubuntu package

    To solve easy you must to modify the /etc/init/php5-fpm.conf and edit

    reload signal USR2

    to

    reload signal USR2

    Al the best.....

  • To solve easy you must to modify the /etc/init/php5-fpm.conf and edit
    
    reload signal USR2
    to
    
    reload signal USR2
    

    What exactly are you changing?

  • @akehat your solution fixed my problem

  • @akehat it seems, he uncommented that line!

8 Answers
That means it's crashing or failing to start. Try rebooting your droplet—does that fix it?

If not, how did you install php5-fpm and what OS are you using?
Installed the OS from the DO dashboard, and, no, I have not rebooted yet. Will do that later tonight.
I meant to ask how you installed php5-fpm, not the OS itself.
Ok, rebooting seems to have fixed whatever the problem was.

Thanks.

This problem reappeared in the 5.6.1 packages for wheezy.
https://github.com/gplessis/dotdeb-php5/issues/45

Commenting out the
reload signal USR2
line in /etc/init/php5-fpm.conf fixes the problem.

Or you can copy php5-fpm.conf to php5-fpm.override without this line and prevent this issue next time.

I have a GitHub repo to fix it for Ubuntu - https://github.com/AbhishekGhosh/Nginx-PHP5-FPM-Restart-Fix-on-Ubuntu

Some work needed on /etc/init.d/php5-fpm && /etc/php5/fpm/php-fpm.conf. All is written there. It is for Ubuntu 13, 14 etc. You possibly need a bit modification.

The problem has reappeared on Nov 2014, hence this fix. Editing only /etc/php5/fpm/php-fpm.conf (or creating php5-fpm.override) will not radically fix it now.
It is marked as known bug now.

OP's OS is not latest Debian for sure.

It worked for me !
root@prod:/etc/nginx/sites-available# service php5-fpm restart
stop: Unknown instance:
php5-fpm start/running, process 11948
root@prod:/etc/nginx/sites-available# vim /etc/init/php5-fpm.conf

uncomment that line
root@prod:/etc/nginx/sites-available# service php5-fpm restart
php5-fpm stop/waiting
php5-fpm start/running, process 11967

Many Thanks ! :D

Vishal Arora

Have another answer? Share your knowledge.