我通过 ssh 安装了 memcache,其中:
$ pecl install memcache
这是输出:https ://pastee.org/w63sy
并将这一行添加到etc/php.ini
:
extension=memcache.so
并且在尝试初始化时:
/* MEMCACHE */
$memcache = new Memcache();
$memcache->pconnect('localhost',11211);
我得到:
Fatal error: Class 'Memcache' not found in /home/piscolab/public_html/website.com/includes/sql.php on line 25
我究竟做错了什么?
我发现了这个问题,但问题出在他的共享服务器上。我在VPS下。
运行php -i | grep php.ini
::
[root@vps ~]# php -i | grep php.ini
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/memcache.so' - /usr/lib/php/modules/memcache.so: cannot open shared object file: No such file o
r directory in Unknown on line 0
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
[root@vps ~]#
查找 memcache.so(无输出)
[root@vps ~]# find / -type f -name memcache*.so'
[root@vps ~]# find / -type f -name memcache*.so
[root@vps ~]#