Title: [Plugin: Memcached Object Cache] Double Function Declaration
Last modified: August 20, 2016

---

# [Plugin: Memcached Object Cache] Double Function Declaration

 *  [syslogic](https://wordpress.org/support/users/syslogic/)
 * (@syslogic)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-double-function-declaration/)
 * One activation it tells me: `Fatal error: Cannot redeclare wp_cache_add() (previously
   declared in /var/www/wp-includes/cache.php:24) in /var/www/wp-content/plugins/
   memcached/object-cache.php on line 22`
 * [http://wordpress.org/extend/plugins/memcached/](http://wordpress.org/extend/plugins/memcached/)

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

 *  Plugin Author [Matt Martz](https://wordpress.org/support/users/sivel/)
 * (@sivel)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-double-function-declaration/#post-3125492)
 * The problem is that the memcached object cache plugin is not a standard plugin.
   It is what is called a “Drop-In”. As such the object-cache.php file should not
   be located at `/var/www/wp-content/plugins/memcached/object-cache.php`, it should
   be moved to `/var/www/wp-content/object-cache.php`
 * What is happening is that WP will look to see if wp-content/object-cache.php 
   exists and if it does, it will use that as opposed to wp-includes/cache.php. 
   Since you have it in the wrong location, it is including both, causing the fatal
   error because of a redeclared function.
 *  Thread Starter [syslogic](https://wordpress.org/support/users/syslogic/)
 * (@syslogic)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-double-function-declaration/#post-3125500)
 * How about …
 * if(!function_exists(‘wp_cache_add’)){
    /* assuming a proper file location */ }
   else { /* notice the user to move the file */ }
 * Like this activation won’t bug out while the user knows why it’s not working.
 *  Thread Starter [syslogic](https://wordpress.org/support/users/syslogic/)
 * (@syslogic)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-double-function-declaration/#post-3125502)
 * If the plugin would have one more file, this one could be used for moving the
   drop-in a level upward; not much functionality contained – just a simple installer
   plug-in package which installs the drop-in.
 *  Plugin Author [Matt Martz](https://wordpress.org/support/users/sivel/)
 * (@sivel)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-double-function-declaration/#post-3125515)
 * That has actually been on my todo list for a while. I actually plan on using 
   the same method as the APC object cache plugin:
 * [http://plugins.trac.wordpress.org/browser/apc/trunk/object-cache.php#L23](http://plugins.trac.wordpress.org/browser/apc/trunk/object-cache.php#L23)

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

The topic ‘[Plugin: Memcached Object Cache] Double Function Declaration’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [Matt Martz](https://wordpress.org/support/users/sivel/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-double-function-declaration/#post-3125515)
 * Status: not resolved