Cache-storingen (WordPresss)
Versie door Jeroen Strompf (overleg | bijdragen) op 20 sep 2022 om 10:02
Some errors, seemingly related to the same caching-related issue
May 2022
Error in May 2022, after cloning a site:
$ wp Fatal error: Uncaught RuntimeException: Failed to locate and load object cache API. in /var/www/example.com/wp-content/object-cache.php:52 Stack trace: #0 /var/www/example.com/wp-includes/load.php(694): require_once() #1 /var/www/example.com/wp-settings.php(131): wp_start_object_cache() #2 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1271): require('...') #3 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1192): WP_CLI\Runner->load_wordpress() #4 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start() #5 phar:///opt/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process() #6 phar:///opt/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap() #7 phar:///opt/wp/php/boot-phar.php(11): include('...') #8 /opt/wp(4): include('...') #9 {main} thrown in /var/www/example.com/wp-content/object-cache.php on line 52
After disabling all kinds of caching-specific settings in wp-config.php, the error message changed:
wp cache Fatal error: Uncaught RuntimeException: Failed to locate and load Object Cache Pro plugin. in /var/www/example.com/wp-content/mu-plugins/redis-cache-pro.php:38 Stack trace: #0 /var/www/example.com/wp-settings.php(349): include_once() #1 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1271): require('...') #2 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1192): WP_CLI\Runner->load_wordpress() #3 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start() #4 phar:///opt/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process() #5 phar:///opt/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap() #6 phar:///opt/wp/php/boot-phar.php(11): include('...') #7 /opt/wp(4): include('...') #8 {main} thrown in /var/www/example.com/wp-content/mu-plugins/redis-cache-pro.php on line 38 Error: Er heeft zich een kritieke fout voorgedaan op deze site.Meer informatie over probleemoplossing in WordPress. Er heeft zich een kritieke fout voorgedaan op deze site.
Then disabled the MU plugins by renaming the folder. Then the problem disappeared.
Sep. 2022
Almost the same error, also during cloning of a site (nl_nl → eur_en) that relied heavily on caching (WP Rocket, Redis, more?):
Fatal error: Uncaught RuntimeException: Failed to locate and load object cache API in /var/www/example.com/wp-content/object-cache.php:56 Stack trace: #0 /var/www/example.com/wp-includes/load.php(694): require_once() #1 /var/www/example.com/wp-settings.php(131): wp_start_object_cache() #2 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1271): require('...') #3 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1192): WP_CLI\Runner->load_wordpress() #4 phar:///opt/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start() #5 phar:///opt/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process() #6 phar:///opt/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap() #7 phar:///opt/wp/php/boot-phar.php(11): include('...') #8 /opt/wp(4): include('...') #9 {main} thrown in /var/www/example.com/wp-content/object-cache.php on line 56 Error: Er heeft zich een kritieke fout voorgedaan op deze site.Meer informatie over probleemoplossing in WordPress. Er heeft zich een kritieke fout voorgedaan op deze site.
What I think it says
- The error is generated in file wp-content/object-cache.php on line 56
- In lines 31-40, this script tries to load various caching-related classes. When they all fail, the exception is thrown.
Solution: Remove object-cache.php
- When I remove file /wp-content/object-cache.php, the error disappears. I believe this file is a drop-in replacement for native WordPress caching. Am I supposed to replace it with some original file, or just leave it like this?
- In the same directory, there is a file advanced-cache.php, that also seems related to Redis or whatever. It seems I can also remove that (=changed the name).