Environment: linux centos7.4 php7.1;
First, install redis expansion step details:
1. Enter usr / local directory
cd /usr/local
2. Download and extract to the current directory redis
wget http://pecl.php.net/get/redis-3.1.2.tgz
tar -zxvf redis-3.1.2.tgz
3, enter unzipped directory redis
cd redis-3.1.2
4, with phpize generate configure profile (your own phpize where you can find it!)
/usr/bin/phpize
5, the path view php-config (configuration when needed later php-config)
whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz
6, configuration
./configure --with-php-config=/usr/bin/php-config
7, compilation
make
8, installation
make install
The following results appear to show that the installation was successful!
Two, PHP7 php.ini configuration
Note: After modifying the configuration is successful, we must save and exit, and restart php service!
vim /etc/php.ini
extension=redis.so
Third, view the results of php extension
php -m
Four, php7 install redis prompt "php-devel is not installed" solution
I execute / usr / bin / phpize reported the following error: "The php-devel package is required for use of this command." Tip php-devel is not installed.
Solutions are as follows:
yum install php-devel
After successful installation, is still being given:
Solution:
Check your php version (yum or rpm is installed before you can use)
rpm -qa |grep php
You can see php version 7.1, you can install php71w-devel!
yum install php71w-devel
The last execution in / usr / bin / phpize, really successful!