Skip to content

Instantly share code, notes, and snippets.

@dougalcampbell
Created February 14, 2012 19:45
Show Gist options
  • Save dougalcampbell/1829603 to your computer and use it in GitHub Desktop.
Save dougalcampbell/1829603 to your computer and use it in GitHub Desktop.
Crontab entry to monitor for php-fpm problems
## Auto-restart PHP when it's returning errors
#
# Make sure that http://localhost/test.php is an actual PHP script. If it starts returning
# 500 errors, restart the PHP-FPM service
* * * * * /usr/bin/curl --head -sf http://localhost/test.php -o /dev/null || /usr/sbin/service php5-fpm restart
@WebBamboo
Copy link

Thanks a lot! Great way to monitor your php-fpm for the occasional Internal Error 500 hell and keep it up until you find the problem :)

@fer-ri
Copy link

fer-ri commented Mar 3, 2016

Thanks a lot :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment