使用“php artisan serve"命令运行 Laravel 有什么意义? [英] Whats the point of running Laravel with the command 'php artisan serve'?

查看:69
本文介绍了使用“php artisan serve"命令运行 Laravel 有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎不明白为什么我们需要使用 php artisan serve 运行 Laravel 应用程序,而不是仅使用 Apachenginx 运行它.我知道在开发过程中,我们使用 artisan 来启动网站,在部署到服务器后,您使用网络服务器来加载网站.

I dont seem to understand why we need to run a Laravel app with php artisan serve vs just running it with Apache or nginx. I know that under development, we use artisan to fire up the site and after deployment to a server, you use the webserver to load up the site.

首先在 artisan 中运行应用程序有什么用?

Whats the use of running the app in artisan in the first place?

推荐答案

serve 命令只是PHP 内置网络服务器,PHP 具有开箱即用的功能,因此使用它的目的是尽快开始测试您的应用程序,您只需要安装 PHP、Composer,您的应用程序就启动了(当然,如果您不需要其他任何东西).但是如果你已经安装了 Nginx,那就没有任何意义了,直接用就好了.

The serve command is just a shortcut for the PHP Built-in Webserver, something PHP has out of the box, so the point of using it is to start testing your application as fast as you could, you just need to install PHP, Composer and your application is up (if you don't need anything else, of course). But if you already have Nginx installed, there is no point at all, just use it.

在生产中使用内置网络服务器是不明智的.

It's not wise to use the Builtin Webserver in production.

这篇关于使用“php artisan serve"命令运行 Laravel 有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆