您好,登錄后才能下訂單哦!
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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。