在thinkphp中经常报“No input file specified.”这样的错误,这个错误很大的程度以为是程序错误,但是修改完静态化之后就可以完美解决。
IIS Noinput file specified
改PHP.ini中的doc_root行,打开ini文件注释掉此行,然后重启IIS
2.请修改php.ini; cgi.force_redirect = 1
去掉前面分号,把后面的1改为0
即
cgi.force_redirect = 0
apacheNo input file specified
apache No input filespecified,今天是我们配置apache RewriteRule时出现这种问题,解决办法很简单如下
打开.htaccess 修改 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
完整代码如下
php5.4版本
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
针对php5.5以上
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule>
如果是apache服务器出问题,请继续做其他错误排查。