1

I am using Azure Cloud, multisite WordPress and have enabled these codes in wp-config.php file.

    // Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

But there is no change. It shows a blank page only and I am unable to find any debug.log file in wp-content folder nor showing any error on the page if I apply "var_dump". What settings should I apply or check?

0

Take out the @ini_set. I'm not sure what your intent is there, but you're doing two different things. Your setting for WP_DEBUG_DISPLAY is telling it to display errors (set to true), and then you're turning around and telling it not to (ini_set to 0).

The value of WP_DEBUG_DISPLAY is used to determine whether ini_set() to set display_errors to 1 or 0. So not only is there no need to set it again, you're actually defining the exact opposite value of what you just set. See wp_debug_mode() where this is set.

The debug.log file will only be created if there is an actual error to display, but it may not necessarily be saved to /wp-content/debug.log by default. If you're not certain it's logging to the default, you can use the WP_DEBUG_LOG constant to define a custom error log file name and location. For example, instead of setting WP_DEBUG_LOG to true (which specifies the default), define the location of the log file when defining the constant:

define( 'WP_DEBUG_LOG', dirname( __FILE__ ) . '/wp-content/my.log' );

Instead of testing this with var_dump(), try writing something to the error log:

error_log( 'checking my error log' );

Then check to make sure the error was written to the error log location you expect it (whether custom or default as described above).

It is possible that the issue you have is a fatal error occurring before WP initializes, in which case you'll need to explore something other than WP for the problem. In that case, you probably do need the ini_set() function, but you need to set it to 1 to display the error on the screen (you have it set to 0, which suppresses on-screen messaging).

3
  • Thanks for the reply. Are you saying to silent this code? bold**@ini_set( 'display_errors', 0 ); **bold . I did the same but no change – WeDevelop Mar 26 '20 at 13:13
  • Yes - your use of ini_set() as you have it in your question is doing the exact opposite of what you defined for WP_DEBUG_DISPLAY right before it. I've added some additional info that may help. – butlerblog Mar 26 '20 at 14:53
  • I am applying the same as you said. but it is not generating file "my.log" on hosting. But if I try on a local server, it works fine. What could be the reason? – WeDevelop Mar 26 '20 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.