Linux installation method Redis for PHP extensions

1. Download phpredis
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

2, install redis
upload phpredis-2.2.4.tar.gz to / usr / local / src directory, and then in turn execute the following command:
cd / usr / local / src # into the package store directory
tar zxvf phpredis-2.2.4. tar.gz # decompression
cd phpredis-2.2.4 # into the installation directory
/ usr / local / php / bin / phpize # configure profile generated by phpize
./configure --with-php-config = / usr / local / php / bin / php-config # configure
make # compile
make install # installed
after the installation is complete, the following installation path
/ usr / local / PHP / lib / PHP / Extensions / NO-Debug-non-ZTS-20,121,212 /
the make test # test
At this point you will be prompted to configure the php.ini file

3, configure php support
vim /usr/local/php/etc/php.ini # edit the configuration file, add the following to the last line
extension = "redis.so"

4, restart the service

/etc/init.d/php-fpm the restart the sudo
. 5, verification
php -m

Guess you like

Origin blog.51cto.com/13293070/2414489
Recommended