這篇文章介紹的內容是關於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
【fphp-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`
$m = new Memcached(); $m->addServer('127.0.0.1','11211'); print_r($m->getStats());
以上是php-memcached擴充安裝的詳細內容。更多資訊請關注PHP中文網其他相關文章!