Install php Redis extension notes under Fedora, fedoraredis
1. Install the compilation tool
Copy codeThe Code is as follows:
Yum install wget make gcc-c ++ zlib-devel openssl-devel pcre-devel kernel keyutils patch perl
Ii. Install redis php-redis
Copy codeThe Code is as follows:
# Yum install redis php-redis
The installation is successful.
Start redis
Copy codeThe Code is as follows:
# 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 to find the phpize and php-config paths
3. Generate configure
Copy codeThe Code is as follows: #/usr/bin/phpize
4. Compile and install
Copy codeThe Code is as follows:
#./Configure -- with-php-config =/usr/bin/php-config
# Make & make install
5. Add the installed redis. so Module
Copy codeThe Code is as follows:
# Vim/etc/php. ini
6. Restart apache or nginx
7. Test
Copy codeThe Code is as follows:
$ Redis = new Redis ();
$ Redis-> connect ('2017. 0.0.1 ', 127 );
$ Redis-> set ('test', 'Hello world! ');
Echo $ redis-> get ('test ');
Add redis extension in php
Check the error log ~
An error occurred while installing redis extension in php.
Your php is compiled by VC6.
Your php_redis.dll is compiled by VC9.
This causes incompatibility.
Find php_redis.dll of VC6.
Or
Reinstall php of VC9
Yes.