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 [...]
↧