問題描述:apache配置網站出現問題“No input file specified.”
解決1:
打開.htaccess 在RewriteRule 后面的index.php教程后面添加一個“?”
如果還是不行,嘗試以下方法:
解決2:
以下文件內容清空或者全部注釋
原文鏈接:https://jingyan.baidu.com/article/f7ff0bfccce11c2e26bb1381.html(感謝分享)
tp5.1 錯誤 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://blog.csdn.net/XinShun/article/details/90241842(感謝分享)