Fix PHP error logging

This commit is contained in:
earnolmartin 2018-11-28 20:50:30 -07:00
parent 0f6443b07e
commit ac04d762af
2 changed files with 16 additions and 0 deletions

View file

@ -2017,6 +2017,14 @@ function ModifyPHPIniConfigForFile(){
sed -i "s#^opcache.enable=.*#opcache.enable=0#g" "$PHPINIFILE"
fi
fi
# Fix PHP error logging
hasPHPErrLogging=$(cat "$PHPINIFILE" | grep -o "^error_log.*")
if [ -z "$hasPHPErrLogging" ]; then
echo "error_log=/var/log/php_errors.log" >> "$PHPINIFILE"
else
sed -i "s#^error_log.*#error_log=/var/log/php_errors.log#g" "$PHPINIFILE"
fi
fi
fi
}

View file

@ -1825,6 +1825,14 @@ function ModifyPHPIniConfigForFile(){
sed -i "s#^opcache.enable=.*#opcache.enable=0#g" "$PHPINIFILE"
fi
fi
# Fix PHP error logging
hasPHPErrLogging=$(cat "$PHPINIFILE" | grep -o "^error_log.*")
if [ -z "$hasPHPErrLogging" ]; then
echo "error_log=/var/log/php_errors.log" >> "$PHPINIFILE"
else
sed -i "s#^error_log.*#error_log=/var/log/php_errors.log#g" "$PHPINIFILE"
fi
else
# Logging
logToInstallLogFile "$PHPINIFILE does not exist!"