Title: PHP fatal error: wp_cache_add() cannot be redefined
Last modified: January 14, 2022

---

# PHP fatal error: wp_cache_add() cannot be redefined

 *  Resolved [sdvservices](https://wordpress.org/support/users/sdvservices/)
 * (@sdvservices)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wp_cache_add-cannot-be-redefined/)
 * Hi,
 * The plugins object-cache.php (symlink) is throwing a fatal PHP error:
 * `PHP Fatal error: Cannot redeclare wp_cache_add() (previously declared in /public/
   wp-content/plugins/wp-redis/object-cache.php:40) in /public/wp-includes/cache.
   php on line 30" while reading response header from upstream, client: x.x.x.x,
   server: hostname, request: "GET /path HTTP/1.1"`
 * Using WordPress 5.8.3
 * Disabling all the plugins did not matter as the conflict comes from WP core.
 * Thanks,
    Sjouke
    -  This topic was modified 4 years, 4 months ago by [sdvservices](https://wordpress.org/support/users/sdvservices/).
    -  This topic was modified 4 years, 4 months ago by [sdvservices](https://wordpress.org/support/users/sdvservices/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wp_cache_add-cannot-be-redefined/#post-15259939)
 * Hey [@sdvservices](https://wordpress.org/support/users/sdvservices/),
 * I think there’s something funky in your site setup. It looks like WP Redis’ `
   object-cache.php` is getting loaded first, and then WordPress core’s `cache.php`
   is loaded afterwords.
 * The standard behavior is to load `wp-content/object-cache.php` if there is one,
   otherwise load `wp-includes/cache.php`. Here’s the corresponding logic: [https://github.com/WordPress/wordpress-develop/blob/b161cfc1ff2566c7be7425339b695aa404bf8dce/src/wp-includes/load.php#L655-L738](https://github.com/WordPress/wordpress-develop/blob/b161cfc1ff2566c7be7425339b695aa404bf8dce/src/wp-includes/load.php#L655-L738)
 * It’s hard to say what the problem is without access to your codebase. However,
   it’s a problem unique to your codebase/configuration, not a problem with WP Redis.
 * Hope this helps point you in the right direction!
 *  Thread Starter [sdvservices](https://wordpress.org/support/users/sdvservices/)
 * (@sdvservices)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wp_cache_add-cannot-be-redefined/#post-15259956)
 * Thanks, I have managed to locate the issue inside the `mu-plugins` directory,
   specifically including `wp-includes/cache.php` there.
 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/wp_cache_add-cannot-be-redefined/#post-15259964)
 * Great!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP fatal error: wp_cache_add() cannot be redefined’ is closed to new
replies.

 * ![](https://ps.w.org/wp-redis/assets/icon-256x256.png?rev=3417699)
 * [WP Redis](https://wordpress.org/plugins/wp-redis/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-redis/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-redis/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-redis/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-redis/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-redis/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/wp_cache_add-cannot-be-redefined/#post-15259964)
 * Status: resolved