CENTOS7 installation Lnmp (PHP7) nginx php-fpm yum Installation and configuration file modification

Source: Internet
Author: User
Tags fpm

1. Because I do not know why, in the Internet to find a lot of information, nginx to and PHP-FPM, so before using Nginx configuration to install PHP-FPM

2.yum Install Php70w-fpm,service php-fpm start

Using Yum install PHP-FPM will error

Error:php70w-common conflicts with php-common-5.4.16-42.el7.x86_64
You could try using--skip-broken to work around the problem
You could try Running:rpm-va--nofiles--nodigest

3.RPM-UVH http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

4.yum Install Nginx

Service Nginx Start

5.

# Find/-name nginx.conf

/etc/nginx/nginx.conf

See in the last line of nginx.conf

include/etc/nginx/conf.d/*.conf;

So find/etc/nginx/conf.d/default.conf;

Add a sibling below the location

Location ~ \.php$ {
root/var/www/html; #指定php的根目录
Fastcgi_pass 127.0.0.1:9000; The default port for the #php-FPM is 9000
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}

6.nginx-t If there are no errors, error to correct

7./usr/sbin/nginx-s Reload restart Nginx service

and build index.php in/var/www/html.

<?php

Phpinfo ();

Can see

CENTOS7 installation Lnmp (PHP7) nginx php-fpm yum Installation and configuration file modification

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.