Is the Memcache PHP client library really there on flex environment?

326 views
Skip to first unread message

Vick Khera

unread,
Oct 25, 2017, 11:37:26 PM10/25/17
to Google App Engine
I'm trying to use the memcached client in a wordpress install for the object cache. However, when I try to use it, I get an error:

Fatal error: Uncaught Error: Class 'Memcache' not found in /app/wordpress/wp-content/object-cache.php:425

Stack trace:
 #0 /app/wordpress/wp-content/object-cache.php(63): WP_Object_Cache->__construct()
 #1 /app/wordpress/wp-includes/load.php(514): wp_cache_init()
 #2 /app/wordpress/wp-settings.php(113): wp_start_object_cache()
 #3 /app/wordpress/wp-config.php(125): require_once('/app/wordpress/...')
 #4 /app/wordpress/wp-load.php(37): require_once('/app/wordpress/...')
 #5 /app/wordpress/wp-blog-header.php(13): require_once('/app/wordpress/...')
 #6 /app/wordpress/index.php(17): require('/app/wordpress/...')
 #7 {main} thrown in /app/wordpress/wp-content/object-cache.php on line 425

This is a wordpress install from following the directions at https://cloud.google.com/php/tutorials/wordpress-app-engine-flexible which mentions the memcached drop-in.

I even added explicitly to my php.ini file:

extension=memcache.so

yet the error persists.

How is one supposed to use Memcache from PHP when the environment cannot load it? The service is enabled in my console, as well. I found some forum post that implied that the Memcache service was not yet released for Flex environment (those were dated from January 2017), but other documentation which says the clients are definitely there. For example https://cloud.google.com/appengine/docs/flexible/php/using-redislabs-memcache says so. No documentation says I have to do anything special to use it.

Can someone point me in the right direction? Thanks!

Yannick (Cloud Platform Support)

unread,
Oct 26, 2017, 12:16:38 PM10/26/17
to Google App Engine
Hello Vick, I'm afraid you are confusing 3 completely different products with similar names. The one you are having trouble with is Memcached Object Cache, a WordPress plugin. The last link you gave plainly refers to redislabs Memcached Cloud.

Both of these products are from third parties and have nothing to do with  App Engine's Memcache.

So to answer your question, App Engine's Memcache is indeed unavailable on the PHP Flexible environment.

As for the Memcached plugin, the tutorial you linked doesn't cover its installation. I was able to follow this tutorial to create a functioning installation of WordPress on App Engine Flexible. Since the Memcached plugin (and all of WordPress, really) is completely unrelated to the Google Cloud Platform I unfortunately cannot help you figure out why you are running into this specific issue. You might want to ask on the WordPress section of Stack Overflow or on the support page of the Memcached plugin.

Vick Khera

unread,
Oct 26, 2017, 1:00:37 PM10/26/17
to Google App Engine
Yeah, I am starting to sort out the confusion now.

My WP site is working well on the Flex environment. I will find other ways of speeding it up. Memcache for the object cache in WP doesn't seem to be helping even using the Redis Cloud variant.

Thanks for your response.

Reply all
Reply to author
Forward
0 new messages