How to install the RedisPHP extension :???? Operating system: CentOSphp installation directory: usrlocalphpphp. ini configuration file path: usrlocalphpetcphp. ining.pdf installation directory: usrlocalnginxNginx website root directory: usrlocalnginxhtml? 1. install the compilation tool yuminstall to install the Redis PHP extension.
Note:
? ? ? ? Operating system: CentOS
Php installation directory:/usr/local/php
Php. ini configuration file path:/usr/local/php/etc/php. ini
Nginx installation directory:/usr/local/nginx
Nginx website root directory:/usr/local/nginx/html
?
1. install the compilation tool
Yum install wget? Make gcc-c ++ zlib-devel openssl-devel pcre-devel kernel keyutils? Patch perl
2. 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? # Decompress
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 ?? # Installation
After the installation is complete, the following installation path appears:
/Usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
3. 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
Restart php-fpm