What the message looks like
PHP Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /var/www/html/wp-content/plugins/beispiel-plugin/inc/helpers.php:42Common causes
- A plugin or theme contains a fatal error, or an update ran only half-way.
- The PHP version does not match the plugin, theme or WordPress, for example after a PHP upgrade at the host.
- The PHP memory limit is used up (
Allowed memory size exhausted). - A required PHP extension is missing, for example
mbstringormysqli. - Damaged core files or faulty edits in
functions.phporwp-config.php.
Check
- Read the error text in the debug log
tail -n 30 /var/www/html/wp-content/debug.log - Check the PHP version and loaded extensions
php -v; php -m | grep -iE 'mbstring|mysqli|curl|xml' - List active plugins (WP-CLI)
wp plugin list --status=active --path=/var/www/html - Find PHP errors in the web server log
grep -i 'fatal' /var/log/nginx/error.log | tail -n 10
Fix
- Enable logging: set
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);inwp-config.php, reload the page and readwp-content/debug.log. - Use recovery mode: WordPress emails the administrator a link that lets you pause the faulty plugin or theme.
- Without backend access, disable all plugins with
wp plugin deactivate --allor rename thewp-content/pluginsfolder, then re-enable them one by one. - Solve a theme problem by activating a default theme:
wp theme list, thenwp theme activate <name>. - Adjust the PHP version to the requirements and install missing extensions; raise the memory limit with
define('WP_MEMORY_LIMIT', '256M');. - Turn debug output off afterwards, and for damaged core files reinstall WordPress (
wp core download --force).
Typical scenario
After an automatic plugin update a site shows “There has been a critical error on this website”. wp-content/debug.log contains a fatal error in a file of the plugin that was just updated and requires PHP 8.1, while the server runs PHP 7.4. The plugin is turned off with wp plugin deactivate, after which the PHP version can be raised in the hosting panel.
FAQ
The recovery email never arrives. What now?
The link goes to the administrator address stored in WordPress and requires working mail delivery. If it is missing, use the debug log and WP-CLI, or rename the plugin folder.
Should WP_DEBUG_DISPLAY stay enabled?
No. On a live site nothing should be displayed, because paths and error details would become public. Write only to the log file and switch the option off after troubleshooting.
How do I find the guilty plugin without dashboard access?
Rename the wp-content/plugins folder via SFTP or SSH. If the site loads afterwards, a plugin is the cause. Rename it back and deactivate the plugin folders one by one until the site works.
Is content lost because of this error?
No. Posts and settings are in the database and stay intact. The error only stops the page from being rendered. Still, back up files and database before making changes.