Nginx+php+redis Environment Construction under CENTOS7
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.rpm set up Nginx's Yum Warehouse# RPM-IVH nginx-release-centos-7-0.el7.ngx.noarch.rpm Download and install Nginx# yum Install nginx start nginx service systemctl start nginx Configuration default configuration file under the/etc/nginx path, using this configuration is already able to run Nginx correctly, if you need to customize, modify the nginx.conf under it and other documents. 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.confDelete the 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
3, Php-redis Install:
Error:the GPG keys listed for the"CentOS-7-updates-163.com" repository is already instarpm--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-7cd/tmpwget https:Github.com/nicolasff/phpredis/zipball/master-o php-redis.zipunzip PHP-redisThe directory after the. zip decompression is: NICOLASFF-phpredis-21D6614CD NICOLASFF-phpredis-21d6614phpize./configuremakemake install confirm that so files are placed in the correct directory Ll/usr/lib/php/modules/redis.sovi/etc/php.ini Add the following Content. Extension=redis.so[[email protected] Phpredis-phpredis-fc673f5]# ll/usr/lib64/php/modules/redis.so
4, PHP-FPM Install:
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<?phpecho phpinfo();?>
Centos7 Installing Nginx