1, Nginx Install:
Download the Nginx bundle (package) corresponding to the current system version
# wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmBuild Nginx's Yum repository# RPM-IVH nginx-release-centos-7-0.el7.ngx.noarch.rpmDownload and install Nginx# yum Install NginxStart Nginx service systemctl start nginx Configuration default configuration file under the/etc/nginx path, using this configuration has been able to properly run Nginx, if you need to customize, modify the nginx.conf and other files under it. Test enter the IP of the machine that deploys the NGINX environment in the browser address bar, if everything is OK, you should be able to see the following words. /etc/nginx/nginx.confDeleteThe comment############################################Location ~ \.php$ {root html; Fastcgi_pass127.0. 0. 1:9000; Fastcgi_index index.php; Fastcgi_param Script_filename/usr/share/nginx/html/$fastcgi _script_name; Include Fastcgi_params; }###########################################Service Nginx Restart
2. Redis Install:
wget http://download.redis.io/releases/redis-3.0.0.tar.gztar zxvf redis-3.0.0.tar.gzcd redis-3.0.0./configure;make;make installredis-server /etc/redis.conf
3, Php-redis Install:
"CentOS-7 - Updates - 163.com"--import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7cd /tmpwget https://github.com/nicolasff/phpredis/zipball/master -O php-redis.zipunzip php-redis.zip解压后目录是:nicolasff-phpredis-21d6614cd nicolasff-phpredis-21d6614phpize./configuremakemake install确认一下so文件已经放置到正确目录ll /usr/lib/php/modules/redis.sovi /etc/php.ini add the following content.extension=redis.so[root@localhost phpredis-phpredis-fc673f5]# ll /usr/lib64/php/modules/redis.so
4, PHP-FPM Install:
astotheby nginxyum install php-fpm
5. Start PHP-FPM Nginx
vi /etc/php-fpm.= yesphp-fpm-c /etc/php.iniservice nginx restart
6. Test Nginx and PHP
http://localhost/test.php
echo phpinfo();?>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above describes the CENTOS7 Nginx+php+redis environment, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.