tp5.1出現no input file specified的問題
昨天在通過composer安裝tp5.1的時候,在本地運行可以顯示出index/index 默認首頁,但是在路由新增一個以後發現只要在地址欄輸入這個路由的路徑例如:www.tp5.com/new 頁面便會出現no input file specified
一開始是以爲php.ini下的open_ssl配置問題.改了之後發現沒有好轉.
後來發現是因爲僞靜態的問題,只需要將/public/.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]
RewriteRule ^(.*)$ index.php
</IfModule>
就可以了 需要注意的是第四行的 # 是一個註釋標籤.