Plesk下安装 PHP Memcached 扩展

默认情况下,Plesk的PHP是不带Memcached扩展的,需要我们自己安装。

plesk-without-memcached, 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的选项了。

plesk-memcached, Plesk下安装 PHP Memcached 扩展

也可以运行

/opt/plesk/php/7.2/bin/php -i | grep "memcached support"

plesk-memcached-enabled, Plesk下安装 PHP Memcached 扩展

如果出现“enabled”就说明安装成功了。