一、centos6.5 yum安装php的memcache扩展
搜索memcache
yum search memcache
有了,现在可以安装了
yum -y install memcached memcached-devel php-pecl-memcache
验证一下安装结果
memcached -h
php -m|grep memcache
启动memcached
/sbin/servive memcached start
测试
<?php
$mem = new Memcache;
$mem->connect("127.0.0.1", 11211);
$mem->set('key1', 'This is first value', 0, 60);
$val = $mem->get('key1');
var_dump($val);
二、centos6.5 编译安装安装php的memcache扩展
说明:
php安装目录:/usr/local/php5
php.ini配置文件路径:/usr/local/php5/et

本文介绍两种在 CentOS 6.5 上安装 PHP Memcache 扩展的方法:通过 yum 安装和从源代码编译安装。包括安装 memcached 服务、配置 PHP 支持 Memcache 以及测试验证。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



