tp5.1 錯誤 No input file specified.


http://www.xxxx.com/admin/index/index

在登錄的時候報錯

出現錯誤:No input file specified.

 

一、方法

 

與php版本有關  PHP版本5.6以上都會出現這個問題  把php版本改為5.5就OK

 

二、方法

.htaccess文件中的

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

在默認情況下會導致No input file specified.

修改成

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

問題解決。

 

 


沒有配置路徑

路徑 :\public\.htaccess.php中配置

<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>

 


官方下面寫法不行

URL重寫
可以通過URL重寫隱藏應用的入口文件index.php(也可以是其它的入口文件,但URL重寫通常只能設置一個入口文件),下面是相關服務器的配置參考:

[ Apache ]
httpd.conf配置文件中加載了mod_rewrite.so模塊
AllowOverride None 將None改為 All
把下面的內容保存為.htaccess文件放到應用入口文件的同級目錄下
<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>
<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>

 

 

官方文件:https://www.kancloud.cn/manual/thinkphp5_1/353955
---------------------
文:https://blog.csdn.net/haibo0668/article/details/80452372


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM