Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 432
KhorneHoly Avatar asked Aug 01 '26 03:08

KhorneHoly


1 Answers

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.

like image 135
Pedro Casado Avatar answered Aug 02 '26 16:08

Pedro Casado



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!