We will need to convince WordPress to show us the actual error. This requires a lot of fiddling, since WordPress has stupidly decided to hide this information very thoroughly –even from the PHP error log files!– since WordPress 5.
First, create the file wp-content/mu-plugins/debug.php
with the following code in it:
<?php
add_filter(
'wp_php_error_message', function ($message, $error) {
if (!defined('MY_CUSTOM_ERROR_HANDLER') || !MY_CUSTOM_ERROR_HANDLER)
{
return $message;
}
$theMessage = $error['message'] ?? '(no message)';
$file = $error['file'] ?? '(no file)';
$line = $error['line'] ?? '(no line)';
$context = <<< HTML
<div style="border: thick solid red; border-radius: 1em; padding: 1em; margin: 1em 0;">
<h4 style="margin: 0 0 0.75em">$theMessage</h4>
<p style="margin: 0">$file:$line</p>
</div>
HTML;
return $context . $message;
}, 10, 2
);
Then, edit your wp-config.php
file. Find the code block below the comment reading “For developers: WordPress debugging mode.“ and change it to the following:
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', true);
define('MY_CUSTOM_ERROR_HANDLER', true);
Now, reproduce your problem. It will come up with a far more detailed error report. Copy it, and paste it to your next reply.
Then, edit your wp-config.php
file again and change the aforementioned lines to:
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', false);
define('MY_CUSTOM_ERROR_HANDLER', false);
This disables the extra logging we added previously as it's not a good idea to have it in production beyond the small amount of time we need to troubleshoot a plugin installation, update, or activation.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!