From 015c093e56ffed04eae7034cda336a330f6d490d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 28 Apr 2022 13:55:24 +0200 Subject: [PATCH] try to improve php logging; set error_log in the right section of the .ini; enable display_errors and display_startup_errors --- plc.d/httpd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plc.d/httpd b/plc.d/httpd index ce5e42e..4002309 100755 --- a/plc.d/httpd +++ b/plc.d/httpd @@ -79,9 +79,12 @@ case "$1" in # log_errors : is On by default # error_log if ! grep '^error_log *=' $php_ini > /dev/null ; then - echo 'error_log = /var/log/php.log' >> $php_ini - touch /var/log/php.log - chmod 666 /var/log/php.log + sed -i -e '/^;error_log = syslog/a error_log = /var/log/php.log' $php_ini + sed -i -e 's/display_errors =.*/display_errors = On/' $php_ini + sed -i -e 's/display_startup_errors =.*/display_startup_errors = On/' $php_ini + # create the log file and make it writable by apache + touch /var/log/php.log + chmod 666 /var/log/php.log fi # configure php-fpm as well if present (starting with f27) -- 2.43.0