您的位置:首页 > 数据库 > Memcache

利用yum 安装 lamp环境搭载 cacti监控和memcached数据库

2016-03-31 19:43 465 查看
今天测试了一下yum安装lamp和cacti监/控已经memcached数据库
首先介绍下我的系统环境 centos6.7 x86—64
1安装cacti
yum install cacti
安装cacti 会自动安装lamp环境,

2接下来是memcached的安装步骤
yum install -y epel-release --安装epel扩展源 里面有提供memcached libmemcached包

yum install -y libevent memcached libmemcached
/etc/init.d/memcached start
[root@localhost ~]# ps aux |grep memcached
498 5101 0.0 0.3 332892 3076 ? Ssl 21:54 0:00 memcached -d -p 11211 -u memcached -m 64 -c 1024 -P /var/run/memcached/memcached.pid
memcached服务正常启用占用11211端口
--可以在/etc/init.d/memcached 和 /etc/sysconfig/memcached自行定义相关的参数
查看状态
[root@localhost ~]# memcached-tool 127.0.0.1:11211 stats
telnet 127.0.0.1 11211测试memcached库连接

3php连接memcached
安装memcache的扩展
cd /usr/local/src
wget http://www.lishiming.net/data/attachment/forum/memcache-2.2.3.tgz
tar zxf memcache-2.2.3.tgz
cd memcache-2.2.3
这里还需要使用到phpize和php-config两个指令
所以要yum install php-devel
在这要说明下 yum安装的指令都在 /usr/bin/ 下 而且 php模块目录是在/usr/lib64/php/ 下 32位的对应/usr/lib/php/
phpize
./configure --with-php-config=/usr/bin/php-config
安装完后会有类似这样的提示Installing shared extensions: /usr/lib64/php/modules/memcache.so
然后修改/etc/php.ini把 extension_dir = "./" 修改为
extension_dir = "/usr/lib64/php/modules/"
并在下面加一行 extension = "memcache.so"
保存退出 使用 php -m |grep memcache 可以查看到php已经加载了memcache

附件:http://down.51cto.com/data/2367531
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php memcache memcac