Home > Backend Development > PHP Tutorial > PHP Redis 装配

PHP Redis 装配

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:28:15
Original
820 people have browsed it

PHP Redis 安装

?

PHP Redis 安装

?

目录:[?-?]

  • 20.4.4.?php-redis.x86_64 : Extension for communicating with the Redis key-value store
  • 20.4.4.1.?pecl 安装
  • 20.4.4.2.?yum安装
  • 20.4.4.3.?源码编译安装
  • 20.4.4.4.?配置 redis.ini
  • 20.4.4.5.?Session 配置

?

文章出处:http://netkiller.github.io/

?

20.4.4.?php-redis.x86_64 : Extension for communicating with the Redis key-value store

20.4.4.1.?pecl 安装

pecl install redis
Copy after login

20.4.4.2.?yum安装

https://github.com/nicolasff/phpredis

yum search redisphp-redis.x86_64 : Extension for communicating with the Redis key-value storepython-redis.noarch : A Python client for redisredis.x86_64 : A persistent key-value database
Copy after login

20.4.4.3.?源码编译安装

安装git版本控制客户端

yum install git
Copy after login

从github仓库中克隆一份代码到本地

git clone git://github.com/nicolasff/phpredis.git
Copy after login

编译安装phpredis; 我暂时没有找到 pecl的phpredis源

cd phpredisphpize./configure --with-php-config=/srv/php-5.4.9/bin/php-configmake && make install
Copy after login

创建配置文件

20.4.4.4.?配置 redis.ini

cat > /srv/php-5.4.9/etc/conf.d/redis.ini <<EOFextension=redis.soEOF
Copy after login

查看安装情况

# php -m | grep redisredis
Copy after login

20.4.4.5.?Session 配置

使用 Redis 存储 Session 数据

session.save_handler = redissession.save_path = "tcp://127.0.0.1:6379"或者使用多个redissession.save_path = "tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2"
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php redis connection problem
From 1970-01-01 08:00:00
0
0
0
About a small error in the redis manual
From 1970-01-01 08:00:00
0
0
0
python2.7 - django cannot connect to redis
From 1970-01-01 08:00:00
0
0
0
I can't connect to redis using php
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template