致命错误:在/my/path中找不到类"Memcached" [英] Fatal error: Class 'Memcached' not found in /my/path

查看:92
本文介绍了致命错误:在/my/path中找不到类"Memcached"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试时:

$mc= new Memcached();

我知道

Fatal error: Class 'Memcached' not found in /my/path

phpinfo表示/etc/php5/apache2/conf.d/20-memcached.ini是作为其他.ini文件加载的.

phpinfo says that /etc/php5/apache2/conf.d/20-memcached.ini is loaded as an additional .ini file.

此文件的内容是此文件:

The content of this file is this one :

; uncomment the next line to enable the module
extension=memcached.so

dpkg --get-selections | grep memcached

dpkg --get-selections | grep memcached

libmemcached6                                   install
memcached                                       install
php5-memcached                                  install

Kubuntu 阿帕奇2.0 php 5.4.4-1

Kubuntu Apache 2.0 php 5.4.4-1

为什么会有这个致命错误?

Why do I have this fatal error ?

推荐答案

基于您的评论,我认为您没有正确安装它.确保您在phpinfo()中看到了see一节,例如:

Based on your comment I don't think you have it installed properly. Make sure you see a see a section in phpinfo() such as:

memcached
memcached support   enabled
Version     x.x.x
libmemcached version    x.xx

1)获取libmemcached

2)配置程序包

3)进行安装sudo make install libmemcached

4)尝试通过使用sudo pecl install memcached

5)确保您的php.ini文件中包含extension = memcached.so

5) make sure you have extension = memcached.so in your php.ini

重新启动Apache

Restart Apache

这篇关于致命错误:在/my/path中找不到类"Memcached"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆