KhorneHoly
KhorneHoly

Reputation: 4766

Symfony 2: MemcachePool not found

I was upgrading my Symfony 2 project, which works with the lws_memcache Bundle.

Now my I get the following error:

ClassNotFoundException in LoggingMemcache.php line 4: Attempted to load class "MemcachePool" from the global namespace. Did you forget a "use" statement?

The File lies in the vendor of the lws_memcache Bundle, so I can't change the code.

My memcached Server is on the version 1.4.14, the bundle itself is the newest verison.

This is what my IDE (PHPStorm 8) shows me when I hover over the Class \MemcachePool in the vendor code.

Multiple definitions exist for class MemcachePool less... (Strg+F1)

Undefined class: Declaration of referenced class is not found in built-in library and project files. Multiple declarations: this version of IDE will have problems with completion, member resolution and inheritance analysis for all classes that have multiple definitions in project files (regardless of includes).

Is there something I can do about it?

Upvotes: 3

Views: 2980

Answers (2)

Pedro Casado
Pedro Casado

Reputation: 1745

LswMemcacheBundle bundle is compatible with memcache 3.0.6 or higher. I was having the same error with php-memcache 2.2.x.

Try upgrading your php-memcache to the new one (3.0.8), but first you need to edit the formula and setup the flags brew edit php56-memcache :

.  20     safe_phpize
.  21 
+  22     ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.11'
+  23     ENV['CFLAGS'] = '-fgnu89-inline'
+  24     ENV['LDFLAGS'] = '-fgnu89-inline'
+  25     ENV['CXXFLAGS'] = '-fgnu89-inline'
+  26 
.  27     system "./configure", "--prefix=#{prefix}",
.  28                           phpconfig
.  29     system "make"

$ brew uninstall homebrew/php/php56-memcache
$ brew install homebrew/php/php56-memcache --devel

Then restart php-fpm + nginx.

Upvotes: 2

Matt
Matt

Reputation: 2371

Make sure your config file has a memcache session pool defined.

Try rebooting the server.

I had the same issue when installing LwsMemcache in my symfony project. I received the exact same error on production as the one above, but on my dev box, It was a different error (can't remember what it said), but had to do with php5 and memcache not working together.

restarting the services for nginx and php5-fpm did not work. I had to reboot and it works fine.

Upvotes: 0

Related Questions