WordPress error: no log, no message, no info

Solution:1

Please follow the below steps:

  1. Paste these below code in wp-config.php
    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_LOG’, true );
    define( ‘WP_DEBUG_DISPLAY’, true );
    @ini_set( ‘display_errors’, 1 );
    define( ‘SCRIPT_DEBUG’, true );
  2. create a file named debug.log in the wp-content directory.

3.Run your WordPress website like before and open debug.log file in any text editor. You will find all the everything (erros) here.

Solution:2

So, I found the script where WordPress handles fatal errors, and where it masks these errors under the generic message:

 

The site is experiencing technical difficulties. Please check your email for instructions.

 

The script /wp-includes/class-wp-fatal-error-handler.php handles these errors, under a try..catch block, which makes it impossible to the error message to show up.

 

So, a temporal solution, only for debugging, is to modify the method handle() to disable the try..catchand log the error message, like shown here:

 

disclaimer: this modification must be undone once the site is put into production, it’s only for debugging purposes.

 

public function handle() {

        if ( defined( ‘WP_SANDBOX_SCRAPING’ ) && WP_SANDBOX_SCRAPING ) {

            return;

        }

        // comment try..catch

        // try {

            // Bail if no error found.

            $error = $this->detect_error();

            if ( ! $error ) {

                return;

            }

 

//log error message

error_log($error[“message”]);

return;

 

            if ( ! isset( $GLOBALS[‘wp_locale’] ) && function_exists( ‘load_default_textdomain’ ) ) {

                load_default_textdomain();

            }

 

            if ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) {

                wp_recovery_mode()->handle_error( $error );

            }

 

            // Display the PHP error template if headers not sent.

            if ( is_admin() || ! headers_sent() ) {

                $this->display_error_template( $error );

            }

        // } catch ( Exception $e ) {

            // Catch exceptions and remain silent.

        // }

    }

The function error_log will log error to wp-content/debug.log in the case that this line exists in your wp-config.php file:

 

define( ‘WP_DEBUG_LOG’, true );

Or to Apache/php error log otherwise.

 

Sure there are other ways and other configurations to debug these errors but this is an easy one.