类“Memcache”未找到于
从 Network Solutions 移至托管站点时,发生错误
致命错误:第 6 行 /data/.../include/connect.inc 中未找到类 'Memcache'
如何修复?我在 cgi bin 文件夹中创建了一个 php.ini 文件,并在其中添加了行 extension = "memcache.so"。但显然该模块本身并不在服务器上。我应该怎么办?通常托管,不是VPS。
抱歉我的英语不好:)
Moved to the site hosting from Network Solutions, the error occurred
Fatal error: Class 'Memcache' not found in / data / ... / include / connect.inc on line 6
How can I fix it? I created a php.ini file in the folder cgi bin, added there the line extension = "memcache.so". But apparently the module itself is not on the server. What should I do? Hosted by usual, is not VPS.
Sorry for my English :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将使用 phpinfo() 输出来识别 php.ini 文件的位置以及是否加载了 Memcache 模块。
如果服务器不是由您管理,那么您在安装此 PECL 模块时可能会遇到问题。
I would use the
phpinfo()
output to identify where thephp.ini
file is and whether the Memcache module is loaded.If the server is not managed by you then you might have problems getting this PECL module installed.
请使用 php -m | grep memcached 检查memcached.so是否加载成功。
- 如果显示
memcached
,则表示成功。- 否则未加载
或者查看phpinfo,看看是否有这样的MemcachedSectionL
if
php -m | grep memcached
显示:这是解决方案:
例如你的 php.ini 是 /etc/php.ini,你的 php.d 是 /etc/php.d/
解决方案 1
vim /etc /php.d/memcached.ini
extension=memcached.so
php -m | grep memcached
检查memcached是否加载成功解决方案2
rm /etc/php.d/json.ini
extension=json.so
extension=memcached.so
之前的php -m | grep memcached
检查memcached是否加载成功Please use
php -m | grep memcached
to check whether memcached.so is loaded successfully.- If show
memcached
, this mean it succeeded.- Else it is not loaded
Or check phpinfo, see whether there is a Memcached SectionL like this
if
php -m | grep memcached
shows:Here is the solusion:
e.g your php.ini is /etc/php.ini, your php.d is /etc/php.d/
Solution 1
vim /etc/php.d/memcached.ini
extension=memcached.so
in /memcached.iniphp -m | grep memcached
check whether memcached is succeed loadedSolution 2
rm /etc/php.d/json.ini
extension=json.so
in php.in beforeextension=memcached.so
php -m | grep memcached
check whether memcached is succeed loaded