这篇文章介绍的内容是关于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());
相关推荐:
Atas ialah kandungan terperinci php-memcached扩展安装. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!