Created
February 14, 2012 19:45
-
-
Save dougalcampbell/1829603 to your computer and use it in GitHub Desktop.
Crontab entry to monitor for php-fpm problems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 :)