Support » Plugin: Memcached Object Cache » Memcached activation error

  • I down loaded the plugin memcached.4.0.0.zip, after a successful install it won’t activate, I receive an error.

    Does anyone know what causes the following error? Fatal error: Cannot redeclare wp_cache_add() (previously declared in /home/hnshwagpa6rs/public_html/nsfwbuttons.com/wp-includes/cache.php:41) in /home/hnshwagpa6rs/public_html/nsfwbuttons.com/wp-content/plugins/memcached/object-cache.php on line 19

    I am using the latest word press. 6.1

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Andrija Vučinić

    (@aidvu)

    Hallo Memcached Object Cache Team

    I experience the exact same error upon activation of your plugin:

    Plugin could not be activated because it triggered a fatal error.
    Fatal error: Cannot redeclare wp_cache_add() (previously declared in /usr/www/users/whalesdrdb/wp-includes/cache.php:41) in /usr/www/users/whalesdrdb/wp-content/plugins/memcached/object-cache.php on line 19

    I followed your installation guide, but the moment the object-cache.php file is copied into the wp-content folder as directed the whole site (back- and frontend) crashes.

    The page caching plugin used is WP-Optimize 3.2.9 with the Vantage theme by SiteOrigin on WordPress 6.1 and the Memcached module has been enabled on my server.

    Plugin Author Andrija Vučinić

    (@aidvu)

    I followed your installation guide, but the moment the object-cache.php file is copied into the wp-content folder as directed the whole site (back- and frontend) crashes.

    What errors do you see? What does “the whole site crashes” mean?

    @aidvu, thank you for your reply.

    What does “the whole site crashes” mean?

    The one where you get the white screen and the following error messages:

    BACKEND:

    “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”

    FRONTEND:

    “The site is experiencing technical difficulties.”

    Plugin Author Andrija Vučinić

    (@aidvu)

    @tigmewp What’s in the PHP and web server logs? It’s fairly hard to figure anything without the logs.

    In general, this plugin shouldn’t be installed. Just the object cache copied over the one in wp-content/.

    There isn’t a file called object-cache.php in the wp-content folder and when I copy the object-cache.php file from your plugin folder into the wp-content folder, then the following error is displayed:

    Fatal error: Uncaught Error: Class "Memcache" not found in /usr/www/users/website/wp-content/object-cache.php:849 Stack trace: #0 /usr/www/users/website/wp-content/object-cache.php(82): WP_Object_Cache->__construct() #1 /usr/www/users/website/wp-includes/load.php(730): wp_cache_init() #2 /usr/www/users/website/wp-settings.php(131): wp_start_object_cache() #3 /usr/www/users/website/wp-config.php(35): require_once('/usr/www/users/...') #4 /usr/www/users/website/wp-load.php(50): require_once('/usr/www/users/...') #5 /usr/www/users/website/wp-blog-header.php(13): require_once('/usr/www/users/...') #6 /usr/www/users/website/index.php(17): require('/usr/www/users/...') #7 {main} thrown in /usr/www/users/website/wp-content/object-cache.php on line 849

    Below is the full PHP error log on the server:

    `[14-Nov-2022 12:28:11 UTC] PHP Fatal error: Cannot redeclare wp_cache_add() (previously declared in /usr/www/users/site/wp-includes/cache.php:41) in /usr/www/users/site/wp-content/plugins/memcached/object-cache.php on line 19
    [14-Nov-2022 12:28:14 UTC] PHP Fatal error: Cannot redeclare wp_cache_add() (previously declared in /usr/www/users/site/wp-includes/cache.php:41) in /usr/www/users/site/wp-content/plugins/memcached/object-cache.php on line 19
    [14-Nov-2022 12:28:14 UTC] PHP Fatal error: Cannot redeclare wp_cache_add() (previously declared in /usr/www/users/site/wp-includes/cache.php:41) in /usr/www/users/site/wp-content/plugins/memcached/object-cache.php on line 19
    [14-Nov-2022 12:28:25 UTC] PHP Warning: Undefined variable $a_regionUrl in /usr/www/users/site/wp-content/themes/whalesandmore/includes/pods-custom-tourism-04-advertiser-widget-template.php on line 161
    [14-Nov-2022 12:28:25 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /usr/www/users/site/wp-content/themes/whalesandmore/includes/pods-custom-tourism-04-advertiser-widget-template.php on line 161
    [14-Nov-2022 12:29:03 UTC] PHP Fatal error: Uncaught Error: Class “Memcache” not found in /usr/www/users/site/wp-content/object-cache.php:849
    Stack trace:
    #0 /usr/www/users/site/wp-content/object-cache.php(82): WP_Object_Cache->__construct()
    #1 /usr/www/users/site/wp-includes/load.php(730): wp_cache_init()
    #2 /usr/www/users/site/wp-settings.php(131): wp_start_object_cache()
    #3 /usr/www/users/site/wp-config.php(35): require_once(‘/usr/www/users/…’)
    #4 /usr/www/users/site/wp-load.php(50): require_once(‘/usr/www/users/…’)
    #5 /usr/www/users/site/wp-blog-header.php(13): require_once(‘/usr/www/users/…’)
    #6 /usr/www/users/site/index.php(17): require(‘/usr/www/users/…’)
    #7 {main}
    thrown in /usr/www/users/site/wp-content/object-cache.php on line 849
    [14-Nov-2022 12:29:14 UTC] PHP Fatal error: Uncaught Error: Class “Memcache” not found in /usr/www/users/site/wp-content/object-cache.php:849
    Stack trace:
    #0 /usr/www/users/site/wp-content/object-cache.php(82): WP_Object_Cache->__construct()
    #1 /usr/www/users/site/wp-includes/load.php(730): wp_cache_init()
    #2 /usr/www/users/site/wp-settings.php(131): wp_start_object_cache()
    #3 /usr/www/users/site/wp-config.php(35): require_once(‘/usr/www/users/…’)
    #4 /usr/www/users/site/wp-load.php(50): require_once(‘/usr/www/users/…’)
    #5 /usr/www/users/site/wp-admin/admin-ajax.php(22): require_once(‘/usr/www/users/…’)
    #6 {main}
    thrown in /usr/www/users/site/wp-content/object-cache.php on line 849`

    I hope this helps?

    Plugin Author Andrija Vučinić

    (@aidvu)

    Fatal error: Uncaught Error: Class “Memcache” not found

    Ok, this makes more sense. There are 2 PHP extensions for the memcached backend.

    https://pecl.php.net/package/memcache (supported)
    https://pecl.php.net/package/memcached (not supported)

    That is what the message is about.

    Hallo @aidvu

    Thank you for your time and efforts, but I am now abandoning this project. It requires more knowledge than I currently possess.

    After following your installation instructions as well as the steps in @ufukart’s 5 star review it still is not working.

    Kind regards,
    Mariska

    Same issue here, gave up on this plugin as installation explanations are sorry to say very confusing and not clear at all

    Fatal error: Cannot redeclare wp_cache_add() (previously declared in /usr/local/www/wordpress/wp-content/object-cache.php:60) in /usr/local/www/wordpress/wp-content/plugins/memcached/object-cache.php on line 19

    Same error here. Can’t say I like the Site Health screen telling me I need an object cache when none of the ones I have tried are detected or install cleanly. Can that test be disabled?

    @paul

    If you have Memcached enabled on your hosting server, then you can try Powered Cache (https://wordpress.org/plugins/powered-cache/). The free version of this caching plugin automatically detects and connects to your server’s Memcached module.

    If you cannot enable the Memcached module on your hosting server, then you can try Docket Cache (https://wordpress.org/plugins/docket-cache/). The plugin stores persistent Object Cache as PHP code.

    Hope this helps.

    • This reply was modified 1 year, 3 months ago by tigmewp.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Memcached activation error’ is closed to new replies.