Build nginx + php + redis environment in Centos7

Source: Internet
Author: User
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
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.