php – Laravel如何在生产中启动服务器

当我运行它输出

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

如何让它在后台运行,当我退出控制台时服务器停止.

解决方法:

简短的回答:不要

Web服务器工匠使用的是PHP内置Web服务器,它不适用于除了开发之外的任何场景,如Built-in web server文档中的摘录所示:

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.

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

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

相关文章

laravel的dd函数不生效怎么办
看不懂laravel文档咋办
安装laravel框架出现command怎么办
Laravel开发API怎么使用事务
laravel怎么构建复杂查询条件
laravel如何实现防止被下载