標籤:php memcache
1、因為php_memcached是依賴libmemcached庫,所以首先安裝libmemcached庫,需要安裝libmemcached-1.x以上版本
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.安裝擴充,這裡我們使用php內建的pecl命令來安裝php擴充。
/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伺服器
service nginx restart
5.重啟php
service php-fpm restart
6.驗證
php -m|grep memcache
memcache
memcached
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/88/42/wKiom1fsvNnAmf4BAAEkp8to68c802.png-wh_500x0-wm_3-wmp_4-s_1355174933.png" title="Image.png" alt="wKiom1fsvNnAmf4BAAEkp8to68c802.png-wh_50" />
本文出自 “IT” 部落格,請務必保留此出處http://wang3781.blog.51cto.com/9428009/1857757
如何安裝php memcache的拓展