DirectAdmin安装pecl-memcached模块并支持sasl

看到网上很多Directadmin的memcache教程都过时了,自己编译调试后,整理了一遍记录下来。

1.先安装依赖包libmemcached
wget https://soft.huayizhiyun.com/manage/directadmin/memcached/pecl-memcached/libmemcached-1.0.18.tar.gz
tar -zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure --prefix=/usr/local/libmemcached --enable-sasl
make
make install
cd ..
2.再安装pecl-memcached模块
PHP5.6版本
wget https://soft.huayizhiyun.com/manage/directadmin/memcached/pecl-memcached/memcached-2.2.0.tgz
tar -zxvf memcached-2.2.0.tgz
cd memcached-2.2.0
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/php56/bin/phpize
./configure --with-php-config=$PHP_PREFIX/php56/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --enable-memcached-sasl
make
make install
echo "extension=memcached.so" >> /usr/local/php56/lib/php.conf.d/20-custom.ini
echo "memcached.use_sasl=1" >> /usr/local/php56/lib/php.conf.d/20-custom.ini
PHP7版本
wget https://soft.huayizhiyun.com/manage/directadmin/memcached/pecl-memcached/memcached-3.0.4.tgz
tar -zxvf memcached-3.0.4.tgz
cd memcached-3.0.4
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/php72/bin/phpize
./configure --with-php-config=$PHP_PREFIX/php72/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --enable-memcached-sasl
make
make install
echo "extension=memcached.so" >> /usr/local/php72/lib/php.conf.d/20-custom.ini
echo "memcached.use_sasl=1" >> /usr/local/php72/lib/php.conf.d/20-custom.ini
3.检查是否加载成功
php -m | grep memcached

1条留言在 “DirectAdmin安装pecl-memcached模块并支持sasl

  • 一位WordPress评论者 留言于

    嗨,这是一条评论。
    要开始审核、编辑及删除评论,请访问仪表盘的“评论”页面。
    评论者头像来自Gravatar


  • 给我留言

    电子邮件地址不会被公开。 必填项已用*标注