Error activating WP_DEBUG

2

I have a problem with my WordPress site. When I set it to wp-config.php , my site gets normal:

define('WP_DEBUG', false);

But when I define

define('WP_DEBUG', true);

The site gives page error not found. And I needed to debug because I have another problem to solve ...

Is there any problem with wp-debug being set to true on a Windows server?

I'm using my website on a Windows server.

    
asked by anonymous 18.11.2015 / 20:49

2 answers

2

The WP_DEBUG constant exhibits problems and alerts related to settings, plugins and even security, so you can not make it active in a production environment .

When you set WP_DEBUG to TRUE, make sure you clear the cache and observe the error log for your site, information about the 404 error (which you claim to be the page not found) may be displayed.

You can also set your Wordpress to not work with friendly URLs in the permanent link options, so you should avoid 404 errors that are apparently a problem with your site's rewrite. (make sure your .htaccess is being read correctly and you do not have AllowOverride None in your server settings).

There is a plugin that can check this out for you:

link

    
18.11.2015 / 21:05
1

Maybe debugging to a file might work around the problem:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false ); // não mostrar na tela
define( 'WP_DEBUG_LOG', true ); // escrever debug em um arquivo
@ini_set('display_errors',0);

With the constant WP_DEBUG_LOG enabled, the debug will be generated in the /wp-content/debug.log file. This constant is used to see Ajax or wp-cron errors that are not displayed on the screen during the execution of the site.

Some time ago, I did a plugin to view that file directly in the WordPress backend.

If even using the direct debug to a file your site still does not work because of these constants, then you should look in your server's error logs to see if there is any hint of what is really happening. This solution is just an alternative to get around the real error (conflict WP_DEGUB with your server), I did a quick search and found nothing related.

    
19.11.2015 / 11:39