Kill Thunder Dog---the Integration of Nginx and PHP under Linux no:33 Linux

Source: Internet
Author: User

In Linux Nginx and PHP we are separate two different programs, unlike in Windows PHP is just a module of Apache only.

So we let them integration can be, the principle is to submit the user's request by Nginx to an nginx, and then he then forwarded to PHP, PHP processing completed he will return the results to nginx ...

First we come to the Nginx conf configuration file directory to edit the nginx.conf file as follows:

Then we remove the # 65 lines to 71 lines and start editing them:

You can modify it as follows:

Location ~ \. php$ {            root           html;            Fastcgi_pass   127.0.0.1:9000;            Fastcgi_index  index. php;            Fastcgi_param  script_filename  /usr/local/nginx/html$fastcgi _script_name;             include         fastcgi_params;        }

Here the path is your own Nginx site storage directory, and then we create a PHP file into the HTML inside the test can be found success, as follows:

Here are a few more places to watch:

Here to load the configuration file where show none then the description does not have a configuration file, then we go to the/usr/local/php5/lib directory to see:

Did not find, because PHP configuration file is similar to xxx.ini this format ...

Then we go to the source code directory of PHP to look at, as follows:

He also prepared two for us ...

Development he means the development environment.

Production he refers to the product environment

Then we can just copy a past.

Then restart the next PHP:

Then in the go to refresh the next page:

This completes the Nginx and PHP integration ...

Kill Thunder Dog---the Integration of Nginx and PHP under Linux no:33 Linux

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.