简体   繁体   English

即使安装了memcache扩展,在wordpress的object-cache.php中也出现了“ PHP致命错误:找不到类'Memcache'”

[英]“PHP Fatal error: Class 'Memcache' not found” occurred in object-cache.php of wordpress even after installed memcache extension

I tried to enable object cache for wordpress by using Memcache. 我尝试使用Memcache为wordpress启用对象缓存。 And I put object-cache.php into /wp-content/, which I get from Memcached Object Cache plugin. 然后将object-cache.php放入/ wp-content /,该文件是从Memcached Object Cache插件获得的。

And then PHP Fatal error: Class 'Memcache' not found occurred. 然后, PHP Fatal error: Class 'Memcache' not found So I install memcache extension by executing sudo yum -y install php-pecl-memcache and sudo service httpd restart . 所以我通过执行sudo yum -y install php-pecl-memcachesudo service httpd restart来安装memcache扩展。 But nothing changed. 但是什么都没有改变。

I also tried to install php-pecl-memcached , not php-pecl-memcache . 我还尝试安装php-pecl-memcached ,而不是php-pecl-memcache But nothing had changed. 但是什么都没有改变。

I confirmed that /etc/php.d/memcache.ini file existed and extension=memcache.so is loaded in the file. 我确认存在/etc/php.d/memcache.ini文件,并且extension=memcache.so已加载到该文件中。

Please give me an advice to solve this. 请给我建议以解决此问题。

When I tried that for new EC2 instance, it worked well. 当我尝试将其用于新的EC2实例时,效果很好。 So I guess my environment is preventing in some ways. 因此,我想我的环境在某些方面有所预防。 Any ideas? 有任何想法吗?

fire the command dpkg -l | 触发命令dpkg -l | grep php5 and check the packages installed. grep php5并检查安装的软件包。 Check for php5-memcache and php5-memcached. 检查php5-memcache和php5-memcached。

If not installed then install those 如果未安装,则安装那些

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM