I've installed PHP 8.2 and Apache2 on an ubuntu 22 machine using the apt commands. I was expecting PHP errors to get logged to the apache2 ErrorLog, which is /var/log/apache2/error.log, but they don't show up there. Nor do they show up in the PHP-FPM error log at /var/log/php8.2-fpm.log. NOTE that I have not modified any conf or ini files form the defaults for Ubuntu's apt install. Are the errors getting logged? If so, where? If not, what is the 'best practice' for turning on this error logging? I want to make sure logrotate will tidy up whatever logs I end up writing to.

    This is from my php.ini:

     592 ; Log errors to specified file. PHP's default behavior is to leave this value
     593 ; empty.
     594 ; https://php.net/error-log
     595 ; Example:
     596 ;error_log = php_errors.log
     597 ; Log errors to syslog (Event Log on Windows).
     598 ;error_log = syslog

      It may be useful to stick a (temporary) page on the site that simply consists of a call to phpinfo() in order to see what the error logging settings are, as well as which of the ini files (yes, plural sometimes) is setting it.

        Write a Reply...