当前位置:Gxlcms > PHP教程 > php-memcached扩展安装

php-memcached扩展安装

时间:2021-07-01 10:21:17 帮助过:18人阅读

这篇文章介绍的内容是关于php-memcached扩展安装,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

【libmemcached安装】

# wget https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz
# tar -zxvf libmemcached-1.0.18.tar.gz
# cd libmemcached-1.0.18
# ./configure --prefix=/usr/local/libmemcached --with-memcached
# make && make install

php-memcached安装】

# wget https://pecl.php.com/get/memcached-3.0.4.tgz
# mv memcached-3.0.4.tgz php-memcached-3.0.4.tgz
# tar -zxvf php-memcached-3.0.4.tgz
# mv memcached-3.0.4 php-memcached-3.0.4
# cd php-memcached-3.0.4
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached/ --disable-memcached-sasl
# make && make install

修改php.ini文件

添加一行:
[memcached]
extension = memcached.so
重启php-fpm:kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`

php测试

$m = new Memcached();
$m->addServer('127.0.0.1','11211');
print_r($m->getStats());

相关推荐:

php-redis扩展安装(phpredis)

以上就是php-memcached扩展安装的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行