Php – Why did php5-fpm restart fail

PHPphp-fpm

I am getting this error when I restart PHP:

Restarting PHP5 FastCGI Process Manager: php5-fpm failed!

I am now phpless. I did touch the config file, but I can’t undo it as I lost my connection and I did not back it up.

Here is my current /etc/php5/fpm/pool.d/www.conf with all the comment lines removed.

[www]
listen = /var/run/php-fastcgi/php-fcgi.socket
user = php-www
group = php-www
pm = dynamic
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 1
pm.max_spare_servers = 5

chdir = /

What’s wrong with that? And what log file can I look into to find the reason it failed?

Best Answer

This happens to me when there's another process running that was spawned from php-fpm. For example, I have a page that runs ImageMagick from command line in order to create thumbnails from images. If I try to restart php-fpm while ImageMagick is still running then it will fail after a timeout of it waiting for the process to finish.