默认情况下,Plesk的PHP是不带Memcached扩展的,需要我们自己安装。
安装环境:
Plesk Onyx 17.5.3 + CentOS 7 + PHP 7.2
安装Memcached
yum install memcached
启动Memcached
service memcached start
安装PECL Memcached
yum install make plesk-php72-devel gcc glibc-devel libmemcached-devel zlib-devel
/opt/plesk/php/7.2/bin/pecl install memcached
修改配置文件
echo "extension=memcached.so" > /opt/plesk/php/7.2/etc/php.d/memcached.ini
验证是否安装成功
plesk bin php_handler --reread
运行完成之后,就能看到memcached的选项了。
也可以运行
/opt/plesk/php/7.2/bin/php -i | grep "memcached support"
如果出现“enabled”就说明安装成功了。