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交易參數有誤,該筆交易暫時無法完成,請聯繫商家解決

我要說說
網上賓友點評