您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
php使用redis-php7.3.4安装redis-5.3.5RC1扩展
发布时间:2021-11-22 23:17:23编辑:雪饮阅读()
首先我需要知道我的php版本及其安装路径:
[root@localhost redis-5.3.5RC1]# php -v
PHP 7.3.4 (cli) (built: Sep 20 2021 23:10:48) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies
[root@localhost redis-5.3.5RC1]# which php
/usr/local/php734/bin/php
在php的扩展官网上找到redis扩展:
http://pecl.php.net/package/redis
底部有如下提示:
Dependencies
Release 5.3.5RC1: PHP Version: PHP 7.0.0 or newer
PEAR Package: PEAR 1.4.0b1 or newer
Release 5.3.4: PHP Version: PHP 7.0.0 or newer
PEAR Package: PEAR 1.4.0b1 or newer
Release 5.3.3: PHP Version: PHP 7.0.0 or newer
PEAR Package: PEAR 1.4.0b1 or newer
那么很显然这里我可以直接使用5.3.5RC1
wget http://pecl.php.net/get/redis-5.3.5RC1.tgz
tar -zxvf redis-5.3.5RC1.tgz
cd redis-5.3.5RC1
/usr/local/php734/bin/phpize
./configure --with-php-config=/usr/local/php734/bin/php-config
make && make install
根据最后的make install结果我们可以查看redis.so是被成功编译出来了:
[root@localhost redis-5.3.5RC1]# ls /usr/local/php734/lib/php/extensions/no-debug-non-zts-20180731/
opcache.a opcache.so openssl.so redis.so
我们将其配置到我们的php.ini上面
[root@localhost redis-5.3.5RC1]# cat /usr/local/php734/lib/php/php.ini | grep redis
extension=/usr/local/php734/lib/php/extensions/no-debug-non-zts-20180731/redis.so
然后我们查看我们配置的redis扩展是否ok了:
[root@localhost redis-5.3.5RC1]# php -r "phpinfo();" | grep redis
PWD => /root/redis-5.3.5RC1
$_SERVER['PWD'] => /root/redis-5.3.5RC1
$_ENV['PWD'] => /root/redis-5.3.5RC1
This program is free software; you can redistribute it and/or modify
关键字词:php7.3.4,redis-5.3.5RC1
相关文章
-
无相关信息