Title: PHP notice: Constant WP_DEBUG already defined
Last modified: August 30, 2016

---

# PHP notice: Constant WP_DEBUG already defined

 *  Resolved [nachtigall](https://wordpress.org/support/users/nachtigall/)
 * (@nachtigall)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/)
 * In my log I get these messages on each request:
 * > PHP Notice: Constant WP_DEBUG already defined in /var/www/xxx/htdocs/wp-config.
   > php on line 79
 * Seems to be caused by this plugin. Commenting out the definition in wp-content/
   plugins/shariff/backend/index.php solves this notice:
 *     ```
       <?php
       // THIS NEEDS TO BE REMOVED TO AVOID:
       // define( 'WP_DEBUG', false );
       ```
   
 * Can this be fixed?
 * [https://wordpress.org/plugins/shariff/](https://wordpress.org/plugins/shariff/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Jan-Peter](https://wordpress.org/support/users/starguide/)
 * (@starguide)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6431756)
 * There is a fix in the next release that takes care of the underlying issue. The
   backend (share counts) do not work, if WP_DEBUG is enabled. Setting WP_DEBUG 
   to false will solve this issue. In order to still be able to test installations
   with a working backend the above line was set, causing a PHP notice, but that
   was better than a not working backend on test installations. WP_DEBUG should 
   never be enabled on live systems.
 * But like I said, I solved the original problem therefore the need for this is
   no longer present. The next release 2.4.0 will probably releases on Monday.
 * JP
 *  Thread Starter [nachtigall](https://wordpress.org/support/users/nachtigall/)
 * (@nachtigall)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6431760)
 * yep, just have it within an if check:
 *     ```
       // in pseudo code
       if WP_DEBUG is enabled:
        disable WP_DEBUG
       ```
   
 * anyway, thanks for fixing 🙂
 *  Plugin Author [Jan-Peter](https://wordpress.org/support/users/starguide/)
 * (@starguide)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6431772)
 * Well, that would only prevent the PHP notice, but the share counts wouldn’t work
   anymore as long as WP_DEBUG is true and therefore would make it hard to test 
   anything with it. Like I said, the PHP notice was the smaller evil at this point.
   Anyways, will be all good on Monday. 😉
 *  Thread Starter [nachtigall](https://wordpress.org/support/users/nachtigall/)
 * (@nachtigall)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6431827)
 * > the share counts wouldn’t work anymore as long as WP_DEBUG is true
 * Then you would just check for this 😉
 *     ```
       if ( defined( 'WP_DEBUG' ) && WP_DEBUG == true ) {
           // set to false
       }
       ```
   
 *  Plugin Author [3UU](https://wordpress.org/support/users/3uu/)
 * (@3uu)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6431917)
 * This suggestion is funny! Okay – sorry – only from programers point of view. 
   WP_DEBUG is a so called constant. You can not change it later in a program. If
   you do it – you will get an error 😉
 * I have released 2.4.0 some minutes ago. It do no longer need the constant.
 *  [Bob Aborn](https://wordpress.org/support/users/bob-aborn/)
 * (@bob-aborn)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6432063)
 * I’m a “new” beginner to WP. Working with weaver II. Was setting up site (it was
   up-loaded, I could link to it on web) and was working on the parent-child functions.
   php and style.css files (following and inputting what I gleaned from WP Beginners
   site). I uploaded the weaver-ii-child folder and then got white screen of death(
   wsd). Removed the file but still wsd. On a help site I found and inserted (into
   the wp-config.php file an “error” reporting code and then on the wsd got this:
   
   Notice: Constant WP_DEBUG already defined in /homepages/17/d272894331/htdocs/
   clickandbuilds/WordPress/MyWordPress/wp-config.php on line 76
 * Notice: Use of undefined constant RSHCP_DEBUG – assumed ‘RSHCP_DEBUG’ in /homepages/
   17/d272894331/htdocs/clickandbuilds/WordPress/MyWordPress/wp-content/plugins/
   rs-head-cleaner-lite/rs-head-cleaner-lite.php on line 104
 * Parse error: syntax error, unexpected ‘}’ in /homepages/17/d272894331/htdocs/
   clickandbuilds/WordPress/MyWordPress/wp-content/themes/weaver-ii/functions.php
   on line 14
 * Please, what do I do with this information?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘PHP notice: Constant WP_DEBUG already defined’ is closed to new replies.

 * ![](https://ps.w.org/shariff/assets/icon.svg?rev=2006307)
 * [Shariff Wrapper](https://wordpress.org/plugins/shariff/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shariff/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shariff/)
 * [Active Topics](https://wordpress.org/support/plugin/shariff/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shariff/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shariff/reviews/)

## Tags

 * [Backend](https://wordpress.org/support/topic-tag/backend/)
 * [PHP Notice](https://wordpress.org/support/topic-tag/php-notice/)
 * [wp_debug](https://wordpress.org/support/topic-tag/wp_debug/)

 * 6 replies
 * 4 participants
 * Last reply from: [Bob Aborn](https://wordpress.org/support/users/bob-aborn/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/php-notice-constant-wp_debug-already-defined/#post-6432063)
 * Status: resolved