We encounter a lot of problems when using thinkphp in Nginx, such as:
No permissions, this is the benefit of Linux Rights Management, we give him permission.
We give him permission to access the normal:
Then we add a lists method for the Indexcontroller controller:
Then we add a lists method, as follows:
Save exit. To visit her.
No ... Because Nginx does not support php behind the URL where there is a slash and followed by a string of parameters: So we have to find a way to get him to support PathInfo.
But let's start with the Apache test under Windows, create a file named: test.php, and the code looks like this:
<? PHP Echo "<pre>"; Print_r ($_server);
Save and then visit her ...
It is clear that he has recognized it here.
Then we create a test.php in the Nginx HTML directory and the same file code as above, as follows:
The no arguments are as follows:
One plus parameter is an error, as shown below:
Our solution is to modify the nginx.conf file 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; Fastcgi_param path_info $1; include fastcgi_params; }
You can then reset the configuration file under the Go directory.
./nginx-s Reload
Then visit the test test:
Ok,nginx has been perfectly supportive of pathinfo ...
Kill lui lei dog---linux no:38 linux under Nginx pathinfo support