Title: Cannot redeclare wp_cache_add()
Last modified: January 20, 2017

---

# Cannot redeclare wp_cache_add()

 *  [Ryan Sutana](https://wordpress.org/support/users/ryscript/)
 * (@ryscript)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/)
 * I unfortunately can’t get this plugin to work I got a fatal error when activating
   the plugin
 * `Plugin could not be activated because it triggered a fatal error.`
 * `Fatal error: Cannot redeclare wp_cache_add() (previously declared in /home/USER/
   public_html/wp-includes/cache.php:27) in /home/USER/public_html/wp-content/plugins/
   memcached/object-cache.php on line 22`
 * Hope to hear you soon
 * Thanks
    -  This topic was modified 9 years, 4 months ago by [Ryan Sutana](https://wordpress.org/support/users/ryscript/).

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

 *  [deltafactory](https://wordpress.org/support/users/deltafactory/)
 * (@deltafactory)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/#post-8703102)
 * How have you installed the object-cache.php file?
 *  [woehler](https://wordpress.org/support/users/woehler/)
 * (@woehler)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/#post-9001675)
 * I had the same issue with a clean install. I save the plugin to the plugins folder/
   wp-content/plugins/memcached.
 * Adding if( !function_exists( ‘wp_cache_add’ ) ){ to line 16 and closing it after
   the last function declaration fixed the problem for me.
 * I also had to add if(! class_exists(‘WP_Object_Cache’) ) { right before the class
   declaration.
 * Probably not the final solution but it got it working for me.
 * Memcache plug version 3.0.1
    Wordpress 4.7.3
 *  [henriquemattos](https://wordpress.org/support/users/henriquemattos/)
 * (@henriquemattos)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/#post-9375993)
 * Using WP Super Cache and now installed Memcached out-of-the-box and got the same
   error. Wouldn’t like to overwrite default code to make it work. 🙁
 *  [deltafactory](https://wordpress.org/support/users/deltafactory/)
 * (@deltafactory)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/#post-9377262)
 * Please follow the installation instructions.
    [https://wordpress.org/plugins/memcached/#installation](https://wordpress.org/plugins/memcached/#installation)
 * Though it’s listed in the directory and recognized as a plugin (because it has
   the Plugin headers), it is really a “drop-in”.
 * Drop-Ins are explained here:
    [https://hakre.wordpress.com/2010/05/01/must-use-and-drop-ins-plugins/](https://hakre.wordpress.com/2010/05/01/must-use-and-drop-ins-plugins/)
 *  [henriquemattos](https://wordpress.org/support/users/henriquemattos/)
 * (@henriquemattos)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/#post-9377307)
 * Great, [@deltafactory](https://wordpress.org/support/users/deltafactory/). Will
   try it and let you aware of the result.
 * Really thankful. 🙂
    Rick

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

The topic ‘Cannot redeclare wp_cache_add()’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/memcached.svg)
 * [Memcached Object Cache](https://wordpress.org/plugins/memcached/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/memcached/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/memcached/)
 * [Active Topics](https://wordpress.org/support/plugin/memcached/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/memcached/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/memcached/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [henriquemattos](https://wordpress.org/support/users/henriquemattos/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-2/#post-9377307)
 * Status: not resolved