简体   繁体   中英

“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. And I put object-cache.php into /wp-content/, which I get from Memcached Object Cache plugin.

And then PHP Fatal error: Class 'Memcache' not found occurred. So I install memcache extension by executing sudo yum -y install php-pecl-memcache and sudo service httpd restart . But nothing changed.

I also tried to install php-pecl-memcached , not 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.

Please give me an advice to solve this.

When I tried that for new EC2 instance, it worked well. So I guess my environment is preventing in some ways. Any ideas?

fire the command dpkg -l | grep php5 and check the packages installed. Check for php5-memcache and php5-memcached.

If not installed then install those

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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