laravel 流明开箱即用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29713635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:22:38  来源:igfitidea点击:

Lumen not working out of the box

laravellaravel-5lumen

提问by zegulas

Just installed Lumen framework. hit the link http://localhost/lumen/public/in my browser and got this following error, anyone got any idea about it? Traced it back to the app.php file in bootstrap folder.

刚刚安装了 Lumen 框架。在我的浏览器中点击链接http://localhost/lumen/public/并出现以下错误,有人知道吗?将其追溯到 bootstrap 文件夹中的 app.php 文件。

lumen application.php error

流明 application.php 错误

回答by Shrikant Bhardwaj

if You want to access lumen project without "php artisan serve"

如果您想在没有“php artisan serve”的情况下访问 lumen 项目

$app->run();replace with $request = Illuminate\Http\Request::capture(); $app->run($request);from this path yourlumenproject/public/index.php

$app->run();$request = Illuminate\Http\Request::capture(); $app->run($request);从此路径 替换为 yourlumenproject/public/index.php

回答by Gujarat Santana

if you want to serve your app in local development you can do this :

如果您想在本地开发中为您的应用程序提供服务,您可以这样做:

php -S localhost:8000 -t public/

and it will serve in localhost in port 8000. hope this help.

它将在 localhost 的 8000 端口中提供服务。希望对您有所帮助。

Note : I'm using Laravel Framework version Lumen (5.2.4) (Laravel Components 5.2.*)

注意:我使用的是 Laravel 框架版本 Lumen (5.2.4) (Laravel Components 5.2.*)

回答by Vivek Texeira

Open your terminal in the root folder run the following command php artisan serve.

在根文件夹中打开终端运行以下命令 php artisan serve

Lumen development server started on http://localhost:8000/

Lumen 开发服务器在http://localhost:8000/ 上启动

回答by lukasgeiter

At the moment Lumen only runs in the domain root.
(I've submitted a PRthat fixes this but it has yet to be merged)

目前 Lumen 只在域 root 中运行。
(我已经提交了修复此问题的PR,但尚未合并)

You have to create a Virtual Hoston your local webserver and point the document root of that to the publicdirectory. After that you can access your app with something like: http://lumen.dev.

您必须在本地网络服务器上创建一个虚拟主机,并将其文档根目录指向公共目录。在此之后,你可以像访问自己的应用程序:http://lumen.dev

A simple alternative to setting this up manually is Laravel Homestead. It is an official Vagrant box made for Laravel, that allows you to easily get your development environment up and running.

手动设置的一个简单替代方法是Laravel Homestead。它是为 Laravel 制作的官方 Vagrant 框,可让您轻松启动和运行开发环境。