Install the Redis extension and the linuxphpredis extension in php in Linux.
Note: The directory permission chomd 777-R
1. Install redis
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
Upload phpredis-2.2.4.tar.gz to the/usr/local/src directory.
Cd/usr/local/src # enter the package storage directory
Tar zxvf phpredis-2.2.4.tar.gz # Extract
Cd phpredis-2.2.4 # enter the installation directory
/Usr/local/php/bin/phpize # Use phpize to generate the configure configuration file
./Configure -- with-php-config =/usr/local/php/bin/php-config # Configuration
Make # compile
Make install # install
After the installation is complete, the following installation path appears:
/Usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
2. Configure php support
Vi/usr/local/php/etc/php. ini # edit the configuration file and add the following content in the last line:
Add
Extension = "redis. so"
: Wq! # Save and exit
3. Restart the service
Sudo service nginx restart
Sudo/etc/init. d/php-fpm restart
Add redis extension in php
Check the error log ~
How is php configured to support redis? What else do I need to extend?
Redis does not need the support of php...