MODX 3.0.4 website not committing PHP errors to logs

Hi folks,

I’m trying to troubleshoot an issue I have on a MODX staging site.

One of my pages generates a 500 error in the browser.

My problem is that I can find no further information about this error - no information is added to either the native PHP error_log file or in MODX’s own error log.

To troubleshoot this, I created a test.php file in the root and added a divide-by-zero calculation:

This file correctly generates a 500 error on the page and it is successfully logged [Divide By Zero error] to the error_log file in the root.

So, next I created a test page in MODX with the same Divide By Zero code:

This too generates a 500 error on the page - but again no information is added to either MODX log or the error_log file.

I can’t understand why PHP errors generated by MODX pages are not appearing in either of the logs.

Where can I start looking?

Thanks in advance for any suggestions.

It’s possible in PHP to set at runtime what gets logged. For example with the error_reporting function.
So it could be that some code turns error reporting off.

You could try setting the system setting debug to see if that changes anything.
Or maybe (temporarily) set display_error to true, so that the error message gets output on screen.

Hey Harry,

Thanks for helping.

In PHP options - I can set display_error to true - but this gives me an empty white page instead of the 500 error page.

OK - enabling debug has helped - I can now see some ERROR entries appearing on-page and in the logs.

This has allowed me to troubleshoot the original problem, thanks!

Still not sure why the MODX log will only show INFO and WARN but not ERRORs when debug is set to 0

I’ll update if I make any sense of it.

As always, thanks Harry!