WordPress启用Memcache后出现500错误

2015年12月22日13:09:52网站建设评论1,717

近日在新服务器上使用了军哥的LNMP一件安装包,看到里面有很多可选插件,就把Memcached安装了下。并按照Wordpress官网教程将object-cache.php文件放到wp-content文件夹内启用了Memcache。但是打开网站时,服务器返回了500 http服务器内部错误状态码。文章源自堕落的鱼-https://www.duoluodeyu.com/2067.html

出现500错误不要着急,可以通过打开wordpress的debug模式查看具体的错误信息,具体方法是找到Wordpress根目录下的wp-config.php,并找到文章源自堕落的鱼-https://www.duoluodeyu.com/2067.html

  1. define('WP_DEBUG', false);

将其修改为:文章源自堕落的鱼-https://www.duoluodeyu.com/2067.html

  1. define('WP_DEBUG', true);

再次打开网站看到服务器返回了以下错误信息:文章源自堕落的鱼-https://www.duoluodeyu.com/2067.html

Fatal error: Class 'Memcache' not found in /wp-content/object-cache.php on line 372文章源自堕落的鱼-https://www.duoluodeyu.com/2067.html

这是由于服务器没有安装Memcache造成的。原来LNMP一件安装包中提供了Memcached安装脚本,安装时会让你选择安装Memcache还是Memcached,由于我安装了Memcached,所以才造成Wordpress启用Memcache后服务器返回500错误。卸载Memcached并选择安装Memcache后,Wordpress成功启用了Memcache缓存加速。文章源自堕落的鱼-https://www.duoluodeyu.com/2067.html

匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定