码迷,mamicode.com
首页 > 系统相关 > 详细

memcache和redis服务器的搭建

时间:2017-06-11 10:23:07      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:init.d   gre   figure   with   start   下载   bsp   tps   amp   

准备工作:打开putty工具进入linux系统登陆后输入以下命令以及修改相关内容

Memcache安装(逐行执行):

yum -y install memcached

/etc/rc.d/init.d/memcached start

cd /usr/local/src/

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 -with-memcached

make && make install

yum install php-devel

wget http://pecl.php.net/get/memcached-2.1.0.tgz

tar -zxvf memcached-2.1.0.tgz

cd memcached-2.1.0

/usr/local/php/bin/phpize

./configure -enable-memcached -with-php-config=/usr/local/php/bin/php-config -with-zlib-dir -with-libmemcached-dir=/usr/local/libmemcached -prefix=/usr/local/phpmemcached

make && make install

vi /usr/local/php/lib/php.ini

/usr/local/nginx/sbin/nginx -s reload

/etc/init.d/php-fpm restart

Windows系统下安装memcache扩展:

下载地址:http://windows.php.net/downloads/pecl/releases/

解压找php_memcache.dll文件复制粘贴到C:\wamp\bin\php\php5.4.3\ext;

修改C:\wamp\bin\apache\apache2.2.22\bin下的php.ini文件extension=php_memcache.dll;

 

 

Redis安装(逐行执行):

 

yum install tcl

 

cd /usr/local/src

 

wget http://download.redis.io/redis-stable.tar.gz

 

tar xzvf redis-stable.tar.gz

 

cd redis-stable

 

make

 

make install

 

/usr/local/src/redis-stable/src/redis-server &

 

备注):检测redis服务

 

ps -ef | grep redis

 

cd /usr/local/src

 

wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

 

tar -zxvf 2.2.4.tar.gz

 

cd phpredis-2.2.4/

 

/usr/local/php/bin/phpize

 

./configure --with-php-config=/usr/local/php/bin/php-config

 

make && make install

 

vi /usr/local/php/lib/php.ini

 

备注):增加新的扩展redis.so

 

/usr/local/nginx/sbin/nginx -s reload

 

/etc/init.d/php-fpm restart

 

Windows系统下安装redis扩展:

 

下载地址: http://windows.php.net/downloads/pecl/releases/

 

解压找php_redis.dll文件复制粘贴到C:\wamp\bin\php\php5.4.3\ext;

 

修改C:\wamp\bin\apache\apache2.2.22\bin下的php.ini文件extension=php_redis.dll;

 

memcache和redis服务器的搭建

标签:init.d   gre   figure   with   start   下载   bsp   tps   amp   

原文地址:http://www.cnblogs.com/guo-qi/p/6980500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!