Record an nginx operation Error

Source: Internet
Author: User

The environment is nginx + php. The error is as follows: common functions and syntaxes of php can be used normally. However, when $ _ GET is used, nginx never receives the get parameter. The following test code:
 
<? Php
 
$ Id = $ _ GET ['id'];
 
Echo $ id;
 
?>
 
Http: // localhost/index. php? Id = 1. Normally, the browser displays 1, but not 1. First, it won't be a browser problem. Even if it is a browser problem, it won't be a problem for both browsers. The problems of the php program itself can be basically ruled out, so there is only the problem of nginx, nginx is a stable version, so this is not caused by a bug. The configuration is incorrect. Nginx parameters are defined in the fastcgi_params file. Take a closer look at the content of the file. The first line should be:
 
Fastcgi_param QUERY_STRING $ query_string;
 
However, it may be because I accidentally pressed the carriage return when modifying the statement, so the first line is empty, which leads to a problem. I deleted the blank lines, restarted nginx, and recovered to normal.
 

From Fresh blog

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.