php7.0.0正式版发布有一段时间了,但是与之对应的扩展组件非常之少,特别是windows上用php7搭建开发平台,组件太少肯定是影响开发的。
目前PHP官网的PECL上日常用到的大部分PHP扩展组件都没有适配PHP7的,这源于PHP7的一些新特性与依赖关系和PHP5有很多不同之处,所以很多组件都需要开发者们经过一段时间的开发以适配PHP7。
PHP官方库里没有PHP7的redis扩展:https://pecl.php.net/package/redis
编译安装下载github地址:https://github.com/phpredis/phpredis/tree/php7
Windows:https://github.com/neil-chen/NeilChen/tree/master/php_redis
立即学习“PHP免费学习笔记(深入)”;
注:php7目录下有php7.dll的选择nts版本;有php7ts.dll的选择ts版本。
Linux安装:
cd phpredis
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
上面的操作完成后,会在/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626目录下生成出一个redis.so文件,下面我们需要把这个so文件加到php.ini中
vi /usr/local/php/etc/php.ini
具体设置如下:
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
extension=redis.so
原贴地址:http://php.upupw.net/news/4/5305.html
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号