WordPress.org

Ready to get started?Download WordPress

Forums

Hide php error message (5 posts)

  1. khdown
    Member
    Posted 3 years ago #

    Error messages are shown in my wordpress dashboard and I can't hide them even I use
    error_reporting(0);
    @ini_set(‘display_errors’, 0);
    in wp-config.php.

    I place the code as below:

    <?php
    error_reporting(0);
    @ini_set(‘display_errors’, 0);

    /**
    * The base configurations of the WordPress.
    *
    * This file has the following configurations: MySQL settings, Table Prefix,
    * Secret Keys, WordPress Language, and ABSPATH. You can find more information
    * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
    * wp-config.php} Codex page. You can get the MySQL settings from your web host.
    *
    * This file is used by the wp-config.php creation script during the
    * installation. You don't have to use the web site, you can just copy this file
    * to "wp-config.php" and fill in the values.
    *
    * @package WordPress
    */

    I wonder if there is a way to hide the php error message. Help.

  2. TheArtofBalance
    Member
    Posted 3 years ago #

    I'm having the same issue. OP have you found a solution?

  3. TheArtofBalance
    Member
    Posted 3 years ago #

    After a bit of digging around I found a file in wordpress that seems to handle most if not all error reporting. /wp-includes/class-wp-error.php

    Do yourself a favor and back that file up before you make any changes to it, (I manually edited the file on my server and when I saved all the php after the code I placed in vanished) and put:

    error_reporting(0);
    @ini_set(‘display_errors’, 0);

    Right after the opening php tags. I have no idea why this doesn't work in wp-config anymore.

  4. Stacy Conaway
    Member
    Posted 2 years ago #

    Thanks very much, this seems to have solved it for me.

  5. colai
    Member
    Posted 2 years ago #

    Thanks, this also solved my problems.

Topic Closed

This topic has been closed to new replies.

About this Topic