thinkphp5報input file specified

字號+ 編輯: 国内TP粉 修訂: IT男在阿里 來源: ThinkPHP 2023-09-11 我要說兩句(0)

網路轉載。

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

閲完此文,您的感想如何?
  • 有用

    0

  • 沒用

    0

  • 開心

    0

  • 憤怒

    0

  • 可憐

    0

1.如文章侵犯了您的版權,請發郵件通知本站,該文章將在24小時内刪除;
2.本站標注原創的文章,轉發時煩請注明來源;
3.交流群: 2702237 13835667

相關課文
  • mac開發接入微信公衆號接口返回報錯 cURL error 56: SSLRead() return error -9806

  • PHP的換行符是什麽

  • pecl安裝程序時報錯Array and string offset access syntax with curly braces is no longer supported

  • 由於商家傳入的H5交易參數有誤,該筆交易暫時無法完成,請聯繫商家解決

我要說說
網上賓友點評