memcached命令行memcached數據導入和導出PHP鏈接memcached memcach
阿新 • • 發佈:2018-08-14
usr 鏈接 lin size for -m tar master con memcached命令行
然後修改php.ini添加一行extension="memcache.so“
檢查/usr/local/php/bin/php-fpm -m [0] => aaa
[1] => bbb
[2] => ccc
[3] => ddd
memcached數據導入和導出
PHP鏈接memcached
先安裝php的memcache擴展
cd /usr/local/src/
wget ?http://www.apelearn.com/bbs/data/attachment/forum/memcache-2.2.3.tgz
tar zxf memcache-2.2.3.tgz?
cd memcache-2.2.3
/usr/local/php-fpm/bin/phpize
./configure --with-php-config=/usr/local/php-fpm/bin/php-config
make && make install
安裝完後會有類似這樣的提示:Installing shared extensions: /usr/local/php-fpm/lib/php/extensions/no-debug-non-zts-20131226/
檢查/usr/local/php/bin/php-fpm -m
下載測試腳本
curl www.apelearn.com/study_v2/.memcache.txt > 1.php 2>/dev/null
1.php內容也可以參考https://coding.net/u/aminglinux/p/yuanke_centos7/git/blob/master/21NOSQL/1.php
執行腳本
/usr/local/php-fpm/bin/php 1.php
或者將1.php放到某個虛擬主機根目錄下面,在瀏覽器訪問,即可看到效果
最終可以看到數據如下:
[1] => bbb
[2] => ccc
[3] => ddd
memcached中存儲session
memcached命令行memcached數據導入和導出PHP鏈接memcached memcach