1

I have been trying to install memcached on an ubuntu server and I followed a lot of tutorials over the internet. I am using 32-bit ubuntu 12.04, php version 5.4.7, xampp server 1.8.1 which are all 32-bit versions. In the end, I followed the tutorial in the below link and I installed all the things listed with no error. http://stevelove.org/2009/09/30/how-to-install-php-memcached-on-an-ubuntu-server/

The only problem I have is that when I installed memcached using "sudo pecl install memcached" command, the extension couldn't be added to php.ini file. Then I used phpinfo() to learn which php.ini file I am using and added extension=memcached.so to the ini file. When I restarted xampp server, php.ini file doesn't work and it tries to download the pages. In the php error log, I get this error.

[30-May-2013 16:42:48 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcache.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0

Since I couldn't enable the extension, even though memcached is listed as installed with php -m command, I get Class memcached not found error when I try to execute my php code. Can someone please help me with this issue?

4

2 回答 2

0

首先,感谢您的回答穆罕默德。我知道 memcache 不是 memcached,正如我所说,当我列出模块时,memcached 似乎已安装(不是 memcache),但是当我使用 phpinfo() 时,没有列出 memcached。

事实证明,即使我安装了 memcached,问题还是 xampp 安装。我删除了安装在 ubuntu 中的 lampp 和 php5 并清除了我安装的所有内容。然后我安装了带有开发包的 xampp 并重新安装了 libmemcached 等。它现在工作正常。

如果有人有类似的问题,我可以详细解释。

于 2013-06-06T15:05:25.473 回答
0

可能是因为您安装了服务器但没有安装扩展程序,请尝试

sudo apt-get install php5-memcached

ps:内存缓存!=内存缓存

于 2013-06-03T01:14:36.393 回答