1、因?yàn)閜hp_memcached是依賴libmemcached庫,所以首先安裝libmemcached庫,需要安裝libmemcached-1.x以上版本
創(chuàng)新互聯(lián)專注于海城網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供海城營銷型網(wǎng)站建設(shè),海城網(wǎng)站制作、海城網(wǎng)頁設(shè)計(jì)、海城網(wǎng)站官網(wǎng)定制、微信小程序服務(wù),打造海城網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供海城網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -zxvf libmemcached-1.0.16.tar.gz
cd libmemcached-1.0.16
./configure -prefix=/usr/local/libmemcached
make && make install
2.安裝擴(kuò)展,這里我們使用php自帶的pecl命令來安裝php擴(kuò)展。
/usr/local/webserver/php/bin/pecl install memcached
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading memcached-2.2.0.tgz ...
Starting to download memcached-2.2.0.tgz (70,449 bytes)
.................done: 70,449 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
libmemcached directory [no] : /usr/local/libmemcached
building in /tmp/pear/temp/pear-build-rootjTskoD/memcached-2.2.0
running: /tmp/pear/temp/memcached/configure --with-libmemcached-dir=/usr/local/libmemcached
...............................
...............................
3、安裝完成后在配置文件添加
vim /usr/local/webserver/php/etc/php.ini
extension=memcached.so
4.重啟web服務(wù)器
service nginx restart
5.重啟php
service php-fpm restart
6.驗(yàn)證
php -m|grep memcache
memcache
memcached