Quantcast
Channel: Slopjong » Technology
Viewing all articles
Browse latest Browse all 58

Monitor PHP warnings and fatal errors

$
0
0
Create the file /usr/local/bin/error-check with the bash script below. #!/bin/bash LOGFILE=/var/log/apache2/error.log EMAIL=you@example.com errors=$(grep "PHP Fatal error" "$LOGFILE" | wc -l) warnings=$(grep "PHP Warning" "$LOGFILE" | wc -l) content=$(cat $LOGFILE) if [ ! -z "$errors" ] then mail -s "There [...]

Viewing all articles
Browse latest Browse all 58

Trending Articles