在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服務器出問題,請繼續做其他錯誤排查。