标签:usr linu bbb oca vpd att 效果 images php
memcached命令行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/
然后修改php.ini添加一行extension="memcache.so“
检查/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放到某个虚拟主机根目录下面,在浏览器访问,即可看到效果
最终可以看到数据如下:
[0] => aaa
[1] => bbb
[2] => ccc
[3] => ddd
memcached中存储session
memcached命令行memcached数据导入和导出PHP链接memcached memcach
标签:usr linu bbb oca vpd att 效果 images php
原文地址:http://blog.51cto.com/13227377/2159607