課程
/后端開發
/ThinkPHP
/快速入門ThinkPHP 5.0--基礎篇
打開localhost/index/Index/index顯示沒有服務
2018-06-15
源自:快速入門ThinkPHP 5.0--基礎篇 2-5
正在回答
在控制器下輸入 php -S localhost:8888 router.php 在瀏覽器輸入 localhost:8888/index/index/index
這是因為沒有把PHP的后綴用APACHE的URL重寫規則隱藏導致的
在入口文件目錄找到文件.htaccess,中添加一段代碼
<IfModule mod_rewrite.c>?RewriteEngine on?RewriteCond %{REQUEST_FILENAME} !-d?RewriteCond %{REQUEST_FILENAME} !-f?RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]</IfModule>#以上是去掉index.php的代碼
<IfModule mod_rewrite.c>
?RewriteEngine on
?RewriteCond %{REQUEST_FILENAME} !-d
?RewriteCond %{REQUEST_FILENAME} !-f
?RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
#以上是去掉index.php的代碼
慕前端1555222
Gp新的一天 回復 慕前端1555222
你不設置隱藏入口文件這種訪問格式肯定是會報錯的
舉報
ThinkPHP5已發布多時,想了解ThinkPHP5的新特性嗎?老司機帶你馬上出發~
2 回答訪問localhost/index/index/index提示有問題
1 回答http://localhost/TP5/app/Index/Index/index
2 回答http://localhost/admin/Index/index
2 回答訪問http://localhost:/index/Index/index失敗
2 回答為什么我訪問localhost/index/index/index 顯示No input file specified.
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-07-07
在控制器下輸入
php -S localhost:8888 router.php
在瀏覽器輸入
localhost:8888/index/index/index
2018-06-24
這是因為沒有把PHP的后綴用APACHE的URL重寫規則隱藏導致的
在入口文件目錄找到文件.htaccess,中添加一段代碼
2018-06-15
你不設置隱藏入口文件這種訪問格式肯定是會報錯的