Laravel如何在生产中启动服务器 [英] Laravel how to start server in production

查看:112
本文介绍了Laravel如何在生产中启动服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行它时,输出:

php artisan serve --port=80
Laravel development server started on http://localhost:80

当退出控制台时,如何使其在后台运行?

How can I make it run in the background, when I exit the console the server stops.

推荐答案

简短答案:不要

artisan使用的Web服务器是PHP内置的Web服务器,除本摘录

The web server artisan uses is the PHP built-in web server, which is not for use in any scenario other than development as showcased by this excerpt from the Built-in web server documentation:

警告此Web服务器旨在帮助应用程序开发.对于测试目的或在受控环境中运行的应用程序演示,它也可能很有用.它并非旨在成为功能齐全的Web服务器.不应在公共网络上使用它.

Warning This web server was designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.

Web服务器仅运行一个单线程进程,因此如果请求被阻止,PHP应用程序将停止运行.

The web server runs a only one single-threaded process, so PHP applications will stall if a request is blocked.

在生产中,您应该使用功能全面的Web服务器,例如 nginx lighttpd 等.

In production you should be using a fully featured web server such as nginx, Apache, lighttpd, etc.

这篇关于Laravel如何在生产中启动服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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