fedora20安装redis

松新
2023-12-01

[root@localhost usr]# wget http://download.redis.io/releases/redis-2.8.3.tar.gz
[root@localhost usr]# tar xzf redis-2.8.3.tar.gz
[root@localhost usr]# cd redis-2.8.3
[root@localhost redis-2.8.3]# make
[root@localhost redis-2.8.3]# cd /src
bash: cd: /src: No such file or directory
[root@localhost redis-2.8.3]# cd src/
[root@localhost src]# ./redis-server ../redis.conf
[16677] 26 Jul 20:00:31.534 * Max number of open files set to 10032
[16677] 26 Jul 20:00:31.535 # Creating Server TCP listening socket *:6379: bind: Address already in use
[root@localhost src]# ./redis-cli
127.0.0.1:6379>

安装phpredis扩展
[root@localhost src]# wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
[root@localhost src]# tar zxvf 2.2.4.tar.gz
[root@localhost src]# cd phpredis-2.2.4/
[root@localhost phpredis-2.2.4]/usr/local/phpize
[root@localhost phpredis-2.2.4]./configure --with-php-config=/usr/bin/php-config
[root@localhost phpredis-2.2.4]# make && make install

php.ini 中添加 extension = redis.so

查看扩展
[root@localhost local]# php -m

重启服务
[root@localhost local]#systemctl restart php-fpm.service

 类似资料: