Xampp localhost无法正常工作

时间:2017-06-05 14:16:21

标签: laravel laravel-5 xampp localhost

我在xampp上运行laravel,我在访问页面时遇到问题, http://localhost/laravel/public/我得到一个很好的登录页面 但是当我举例http://localhost/laravel/public/smokeyard

404

出现The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.错误

路线:

Route::get('smokeyard', 'GuzzleController@smokeyard');

控制器:

function smokeyard(){
    return view('smokeyard');
}

我的所有观点都位于资源文件夹中。

2 个答案:

答案 0 :(得分:5)

如果您想在不运行fonct: function(/*no ovar*/) { //... oModel.read("/alertSet", { success: function(data) { //... boo1 = /*new value*/; alert(boo1); }.bind(this) }); } 的情况下访问laravel项目,则需要更改一些设置,

  1. 从您artisan serve

  2. .htaccess中的public folderpaste复制root folder个文件
  3. application rename

  4. 中的server.php

    现在转到root directory to index.php查找要检查的网址

    希望这会有所帮助

答案 1 :(得分:0)

运行php artisan serve并在http://localhost:8000访问您的服务器。你的路线应该可以正常工作。

您无法使用xampp直接通过文件夹结构访问您的laravel应用程序路径。您需要设置Web根目录以指向public文件夹并访问localhost或运行laravel服务器并使用它。这是因为当您以laravel方式访问路径时,URL重写将失败。