我在本地主機安裝laravel +作曲,然後我試着用這段代碼塊運行基本routes.php文件:PHP Laravel框架路由錯誤
Route::get('/x', function()
{
return 'Hello World';
});
,然後我嘗試用這種http://localhost/laravel/app/x
運行它和http://localhost/laravel/x
,我想趁自己這個錯誤類型:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.4 (Unix) PHP/5.5.3 OpenSSL/1.0.1e mod_perl/2.0.8-dev Perl/v5.16.3
我怎樣才能解決這個問題?
在路由中刪除/之前的x。重新配置您的虛擬主機設置,將您的公共文件夾指向根目錄,這樣您就不必執行您對網址的操作。如果仍然有問題,請聯繫我gtalk sarmenhb(at)gmail(dot)com –