WordPress.org

Ready to get started?Download WordPress

Forums

How to display fatal PHP errors (5 posts)

  1. rsm08
    Member
    Posted 3 years ago #

    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!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try looking in your server's error.log file.

  3. rsm08
    Member
    Posted 3 years ago #

    That only shows server errors and not PHP errors.

    I'm looking for a way to stop WordPress from preventing the PHP errors to appear on screen as they would normally do..

    Anyone?

  4. giant slayer
    Member
    Posted 2 years ago #

    I am having the same issue now. Previously, I was getting the php error displaying on the web browser with the error type and the line number it was on, but with the latest wordpress upgrade, I am no longer seeing the php errors on the screen. Now it is just showing a blank page.

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    If this is a live site, that would be correct. Displaying errors can create security problems as you may be exposing paths etc to would-be hackers. But you can enable error logging in WordPress - although I would not recommend that it is left on for any length of time on a live site.

Topic Closed

This topic has been closed to new replies.

About this Topic