Blogger Information
Blog 2
fans 0
comment 0
visits 1553
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php安装redis扩展 windows及linux
rayZ的博客
Original
778 people have browsed it

一、php安装redis扩展(linux环境,所用php版本是7)

1、在 /usr/local/src目录下 xia zai:wget -c https://github.com/phpredis/phpredis/archive/php7.zip

2、解压并进入目录

unzip php7.zip && cd php 7

3、执行/usr/local/php/bin/phpize

#用phpize生成configure配置文件 若这一步报错:Cannot find config.m4. Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module,解决方法如下

到php的安装目录下如:cd /usr/local/php/php-7.0.4/ext/openssl 执行命令:  cp ./config0.m4 ./config.m4 即可解决

4、切换到/usr/local/src/phpredis-php7目录下运行 ./configure --with-php-config=/usr/local/php/bin/php-config

5、编译和安装 make && make install

6、修改php.ini配置文件在最后一行加入:extension="redis.so"

7、重启php程序,/etc/init.d/php-fpm restart

二、php安装redis扩展(windows环境、所用php版本为5.3)

1、xia zai与php版本对应的php-redis扩展文件(https://windows.php.net/downloads/pecl/snaps/redis/)

2、将扩展文件放入php安装目录下的ext文件夹中

Image.png

3、修改php.ini,添加如下语句

Image.png

4、查看phpinfo是否支持redis

Image.png

5、安装与扩展对应的redis版本(https://download.redis.io/releases/ )

(如没有相应版本,大版本号相同的版本替换一下试试,如上2.2.7可使用2.6版本redis,但不能使用3.2版本 redis)

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post