[英]Symfony 2: MemcachePool not found
I was upgrading my Symfony 2 project, which works with the lws_memcache Bundle. 我正在升级我的Symfony 2项目,该项目与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.
LoggingMemcache.php中的ClassNotFoundException第4行:尝试从全局命名空间加载类“MemcachePool”。 Did you forget a "use" statement?
你忘记了“使用”声明吗?
The File lies in the vendor of the lws_memcache Bundle, so I can't change the code. 文件位于lws_memcache Bundle的供应商中,因此我无法更改代码。
My memcached Server is on the version 1.4.14, the bundle itself is the newest verison. 我的memcached Server是1.4.14版本,捆绑包本身就是最新的版本。
This is what my IDE (PHPStorm 8) shows me when I hover over the Class \\MemcachePool
in the vendor code. 当我将鼠标悬停在供应商代码中的Class
\\MemcachePool
,这就是我的IDE(PHPStorm 8)显示的内容。
Multiple definitions exist for class MemcachePool less... (Strg+F1)
MemcachePool类少有多个定义......(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).
多个声明:此版本的IDE 将在项目文件中具有多个定义的所有类(无论包含哪个)的完成,成员解析和继承分析方面存在问题。
Is there something I can do about it? 有什么我可以做的吗?
LswMemcacheBundle bundle is compatible with memcache 3.0.6 or higher. LswMemcacheBundle包与memcache 3.0.6或更高版本兼容。 I was having the same error with php-memcache 2.2.x.
我和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
: 尝试升级你的php-memcache到新的(3.0.8),但首先你需要编辑公式并设置标志
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. 然后重启php-fpm + nginx。
Make sure your config file has a memcache session pool defined. 确保您的配置文件定义了memcache会话池。
Try rebooting the server. 尝试重新启动服务器。
I had the same issue when installing LwsMemcache in my symfony project. 在我的symfony项目中安装LwsMemcache时遇到了同样的问题。 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.
我收到与上面一个完全相同的错误,但在我的开发盒上,这是一个不同的错误(不记得它说的是什么),但与php5和memcache不能一起工作。
restarting the services for nginx and php5-fpm did not work. 重新启动nginx和php5-fpm的服务不起作用。 I had to reboot and it works fine.
我不得不重启,它工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.