php-memcached扩展安装
程序员文章站
2022-03-11 18:30:22
...
这篇文章介绍的内容是关于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.net/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-memcached扩展安装的详细内容,更多请关注其它相关文章!
上一篇: css3怎样设置一行显示多少个字符
下一篇: php中如何使用C语言写扩展