When we receive errors in our systems (could be Modx, Expression Engine, a bespoke app), usually display errors is off in these apps by default. So we just get blank screens, or Internal Server errors.
I thought these errors would still be logged somewhere, but they never are. No PHP errors in apache error, or the users own error log in their directory.
We always have to find out how to turn errors on in the application we are using so we can see them in the browser, which is not good.
So is there some settings somewhere to make sure PHP logs errors to a file, preferably the error log in the users home/log directory, but failing that the global apache error log.
Virtualmin uses the PHP config provided by the distro by default… and distros have those setup to put PHP errors and warnings into the Apache log for that domain.
PHP should log errors and warnings by default… it’s possible that those have been turned off, or it’s also possible that the application is, for some reason, not throwing errors as expected.
This is my php.ini file, but no PHP errors are logged anywhere. I know PHP errors occur because in my application, if I set display_errors to 1 somewhere, they are output. No log file is set, what is the default?
display_errors = Off
log_errors = On
; Log errors to specified file. PHP’s default behaviour is to leave this value
Error reporting in php.ini is:
error_reporting = E_ALL & ~E_DEPRECATED
But in the application from earlier (Modx) site is:
error_reporting(E_ALL & ~E_NOTICE);
This wad the site that resulted in a blank page. And only when I added the following line did a PHP error output to the browser:
ini_set(‘display_errors’,1);
But this is the situation on various applications we use, and on several Virtualmin servers (hence me raising the issue here).