Description:
PHP installation directory:/USR/LOCAL/PHP5
PHP.ini configuration file path:/usr/local/php5/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 gcc-c++ zlib-devel OpenSSL openssl-devel pcre-devel kernel keyutils Patch Perl
2, Installation Phpredis
https://github.com/owlient/phpredis/downloads/#进入下载页面, download owlient-phpredis-2.1.1-1-g90ecd17.tar.gz, upload to cd/usr/ LOCAL/SRC Directory
CD/USR/LOCAL/SRC #进入软件包存放目录
Tar zxvf owlient-phpredis-2.1.1-1-g90ecd17.tar.gz #解压
CD Owlient-phpredis-90ecd17 #进入安装目录
/usr/local/php5/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/php5/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following interface appears, remembering the following path, which will be used later
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/#phpredis模块路径
3. Configure PHP support Phpredis
Vi/usr/local/php5/etc/php.ini #编辑配置文件, add the following on the last line
extension= "Redis.so"
4. Testing
vi/usr/local/nginx/html/phpinfo.php #编辑
<?php
Phpinfo ();
?>
wq! #保存退出
Service php-fpm Restart #重启php-fpm
Service Nginx Restart #重启nginx
Browser open phpinfo.php as shown, you can see Memcache related information
At this point, Linux under the installation of PHP Phpredis installation completed!
Linux under PHP installation Phpredis