http://demo.uctoo.deetaa.com/.php?s=/install/step1.html
类似这样,入口文件名错误;
查thinkphp源码;
if(!IS_CLI) { // 当前文件名 if(!defined('_PHP_FILE_')) { 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'],'/')); } } if(!defined('__ROOT__')) { $_root = rtrim(dirname(_PHP_FILE_),'/'); define('__ROOT__', (($_root=='/' || $_root=='\')?'':$_root)); } }
无奈PHP_SELF 却为空;当然在win上这个是有值的和SCRIPT_NAME 一样的;
环境为centos6.5 nginx1.7 php 5.56 支持fastCGI
解决:可以直接取SCRIPT_NAME;