1. Install the compilation tool
yum install wget make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel kernel keyutils patch perl
2. Install redis php-redis
# yum install redis php-redis
The installation is successful
Start redis
# sudo redis-server /etc/redis.conf
1. Download the php-redis zip installation package
https://github.com/ nicolasff/phpredis
2. Find the PHP installation path
Command whereis phpize and whereis php-config Find the phpize and php-config paths
3. Generate configure
# /usr/bin/phpize
4. Compile and install
# ./configure --with-php-config=/usr/bin/php-config # make && make install
5. Add the installed redis .so module
# vim /etc/php.ini
6. Restart apache or nginx
7. Test
$redis = new Redis(); $redis->connect('127.0.0.1',6379); $redis->set('test','hello world!'); echo $redis->get('test');
For more related articles about installing php Redis extension notes under Fedora, please pay attention to the PHP Chinese website!