close

Laravel 5.3

PHP版本 7.0

使用Xampp

 

第一次使用Route 

預設的

Route::get('/', function () {
    return view('hello.hello');
   // return 'Hello Laravel~';
});

可以正常運作

Route::get('/contact', function () {
    return view('hello.hello');
   // return 'Hello Laravel~';
});

卻無法顯示而且網頁顯示為 Object not found!

 

後來解決方法:

修改apache 之中的http.conf

原先的 DocumentRoot為 "D:/xampp/htdocs"

修改為 DocumentRoot "D:/xampp/htdocs/project_001/public"

之後重新啟動apache

 

原先的網址為 http://localhost/project_001/

後來修正後為 http://localhost/

 

參考網站: 

https://segmentfault.com/a/1190000002724037

https://laracasts.com/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5

 

arrow
arrow
    文章標籤
    laravel php
    全站熱搜
    創作者介紹
    創作者 allblue1928 的頭像
    allblue1928

    allblue1928的部落格

    allblue1928 發表在 痞客邦 留言(0) 人氣()