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