How to display fatal PHP errors
I find it extremely tedious to debug my plugins and themes, because I simply can’t get WP to display PHP errors. I get either white screen or a partially loaded page, ending where the error is.
So at the moment I debug by going through my code and putting in dummy echos different places to see where the script fails, slowly getting closer to the problem, which often is just a typo.
In some cases the error does display, but mostly not.
I tried all the advice you find on forums/blogs, etc.
– Putting php_flag display_errors on in .htaccess
– define(‘WP_DEBUG’, true); in wp-config.php
– define(‘WP_DEBUG_DISPLAY’, true); in wp-config.php
– php.ini display_errors is set to on
Nothing works. I can only get it to display the useless Notices, never the fatal PHP error that makes the script fail.
Hope someone can help, thanks!
- The topic ‘How to display fatal PHP errors’ is closed to new replies.