php安装php的redis扩展的方法:
1. 安装redis
Redis安装流程请移步 https://www.cnblogs.com/IT-Crowd/articles/10626765.html
2. 下载Redis扩展
立即学习“PHP免费学习笔记(深入)”;
[root@root php-extension]# wget https://pecl.php.net/get/redis-4.3.0.tgz
3. 解压 tar -zxvf redis-4.3.0.tgz
[root@root php-extension]# tar -zxvf redis-4.3.0.tgz
4. 生成configure配置文件
[root@root php-extension]# cd redis-4.3.0 [root@root redis-4.3.0]# /usr/local/php/bin/phpize
5.安装redis扩展
[root@root redis-4.3.0]# ./configure --with-php-config=/usr/local/php/bin/php-config [root@root redis-4.3.0]# make && make install
安装完成提示:
Build complete. Don't forget to run 'make test'. Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/
6.在php.ini中添加Redis扩展
首先配置extension_dir:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/"
在extension_dir下面添加 extension = redis.so
7.重启PHP
[root@root redis-4.3.0]# service php-fpm restart
8.Redis扩展安装成功
相关参考:php中文网
以上就是如何安装php的redis扩展的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号