Add the WP_CACHE_KEY_SALT constant to the wp-config.php:phpdefine( 'WP_CACHE_KEY_SALT', '...long random string...' );
So the question is, what’s the recommended way of using Memcached these days? Is the recommendation a blank “use Redis instead, stoopid!” or is the documentation linking to the wrong plugin or something?
All help, feedback or hate is welcome with open arms.
Unlike regular plugins, it is not meant to be installed under wp-content/plugins. Drop-in plugins are meant to be copied to some specific locations. In this case, web/app/object-cache.php.
Check the list of drop-in plugins from the source code of _get_dropins().
Can a plugin auto-activate?
It could because WordPress core loads drop-in plugins very early in its lifecycle. Actually, there is no way for you to deactivate drop-in plugins.
Add the object-cache.php that you linked here: public/content/object-cache.php (I’m testing this on a Radicle project so maybe the gitignore part should be updated to include Radicle as well?), and run the commands that you’ve included.
I visit the site and I get this message:
Fatal error: Uncaught Error: Class "Memcache" not found in /srv/www/example.se/current/public/content/object-cache.php:849 Stack trace: #0 /srv/www/example.se/current/public/content/object-cache.php(82): WP_Object_Cache->__construct() #1 /srv/www/example.se/current/public/wp/wp-includes/load.php(893): wp_cache_init() #2 /srv/www/example.se/current/public/wp/wp-settings.php(147): wp_start_object_cache() #3 /srv/www/example.se/current/public/wp-config.php(11): require_once('/srv/www/example...') #4 /srv/www/example.se/current/public/wp/wp-load.php(55): require_once('/srv/www/example...') #5 /srv/www/example.se/current/public/wp/wp-admin/admin.php(35): require_once('/srv/www/example...') #6 /srv/www/example.se/current/public/wp/wp-admin/plugins.php(10): require_once('/srv/www/example...') #7 {main} thrown in /srv/www/example.se/current/public/content/object-cache.php on line 849
Pull my hair trying to fix it. I got a lot of hair so that part is fine.
30 min later
So the issue is that we’re using Memcached while the plugin is using Memcache.
The solution? Use this plugin instead which uses Memcached:
The moment I added that plugin it started magically working. Feel free trying it on a newly provisioned server and see if it works for you too! If not, I’ll try it myself next week or whenever the reconstructing at work is fully complete. Working without an external screen is hell, man!