LNMP after installing the package on one click, it is found that thinkphp's PathInfo mode is not available.
Baidu, found nginx/conf/vhost/domain name file has opened PathInfo instructions, so started the pathinfo.
But the project still didn't work, so I ran the code on both the local and the server:
var_dump($_SERVER);
Find Php_self This one is different, so the problem may be here.
Next, search for php_self in the project and find this file:
thinkphp.php
if(IS_CGI) { //CGI/FASTCGI模式下 $_temp = explode('.php',$_SERVER['PHP_SELF']); define('_PHP_FILE_', rtrim(str_replace($_SERVER['HTTP_HOST'],'',$_temp[0].'.php'),'/')); }else { define('_PHP_FILE_', rtrim($_SERVER['SCRIPT_NAME'],'/')); }
That is, thinkphp relies on php_self in CGI mode, and the problem is here.
Finally Baidu again, originally is php.ini in order to shield a flaw set up:
cgi.fix_pathinfo=0
It is this line setting that causes the value of the php_self to deviate.
However, the pathinfo.conf in the LNMP integration pack has been used
$fastcgi_script_name =404
Resolves this vulnerability, so we can modify php.ini to
cgi.fix_pathinfo=1
Restart the server, OK, problem solving
The above describes the Nginx server under the use of thinkphp PathInfo model, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.