Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel how to start server in production

When I run it outputs:

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.

like image 684
IvRRimUm Avatar asked Jan 24 '16 17:01

IvRRimUm


People also ask

Is Laravel sail production ready?

Sail is meant as a development tool and not as a production tool.

How do I start Laravel in terminal?

First, download the Laravel installer using Composer. Make sure to place the ~/. composer/vendor/bin directory in your PATH (or C:\%HOMEPATH%\AppData\Roaming\Composer\vendor\bin if working with Windows) so the laravel executable is found when you run the laravel command in your terminal.


1 Answers

Short answer: DON'T

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:

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.

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

like image 85
Bogdan Avatar answered Oct 15 '22 01:10

Bogdan