try to improve php logging; set error_log in the right section of the .ini; enable...
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 28 Apr 2022 11:55:24 +0000 (13:55 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 28 Apr 2022 11:55:24 +0000 (13:55 +0200)
plc.d/httpd

index ce5e42e..4002309 100755 (executable)
@@ -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)