1. nginxinstall: Download the nginx package of the current system version # wgethttp: // response-
1. nginx install:
Download the nginx package corresponding to the current system version)
# Wget unzip rpm-ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm download and install nginx # yum install nginx start nginx service systemctl start nginx configure the default configuration file in the/etc/nginx path, you can use this configuration to run nginx correctly. if you need to customize it, modify the nginx under it. conf and other files. Enter the IP address of the machine where the nginx environment is deployed in the browser address bar. if everything is normal, you can see the following content. /Etc/nginx. conf delete the comment #################################### ####### location ~ \. Php $ {root html; fastcgi_pass 127.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:
Error: the GPG keys listed for the "CentOS-7-Updates-163.com" repository are already instarpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7cd/tmpwget https://github.com/nicolasff/phpredis/zipball/master-O php-redis.zipunzip after unzipping the php-redis.zip is: nicolasff-phpredis-21d6614cd nicolasff-phpredis-21d6614phpize. /configuremakemake install: Check whether the so file has been placed in the correct directory 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:
so as to parse the php by nginxyum install php-fpm
5. start php-fpm nginx
vi /etc/php-fpm.conf daemonize = yesphp-fpm -c /etc/php.iniservice nginx restart
6. test nginx and php
http://localhost/test.php