Nginx Server and PHP server distributed deployment

Source: Internet
Author: User
Tags php server phpinfo nginx server

( 1 ) Settings IP

Nginx Server: 192.168.1.10 nginx1.6.2

PHP Server: 192.168.1.11 php5.3.29


( 2 ) installed. Nginx and the PHP , where Nginx Services and PHP-FPM Service Open normally

( 3 the configuration file is very important to write, the Novice's big Pit, as follows:

    • nginx.conf the key is

Location ~ \.php$ {

root HTML;

Fastcgi_pass 192.168.1.11:9000;

Fastcgi_index index.php;

Fastcgi_param script_filename/application/nginx/html/$fastcgi _script_name;

Include Fastcgi_params;

}

    • Key points: The place of the big pit is this one.

Fastcgi_param script_filename/application/nginx/html/$fastcgi _script_name;

        /application/nginx/html/ this path should not be thought of as nginx php server directory, this directory is to be established in Span style= "FONT-FAMILY:CALIBRI;" >php server, then put .php Span style= "Font-family:simsun;" > Put the file into the nginx file not found nginx

    • php-fpm.conf the key is


remove this line of comments listen.allowed_clients =, fill in Nginx Server's IP

listen.allowed_clients= 192.168.1.10

Remove the comment that listens there and change it to:


; Note:this Valueis Mandatory.

listen= 192.168.1.11:9000

Restart PHP-FPM , and then in PHP site root directory on the server /application/nginx/html/ put phpinfo.php , you can open it successfully phpinfo.php up.


This article is from the "biohazard2k" blog, make sure to keep this source http://biohazard2k.blog.51cto.com/68212/1617753

Nginx Server and PHP server distributed deployment

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.