Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the point of running Laravel with the command 'php artisan serve'?

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.

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

like image 700
captainblack Avatar asked Nov 30 '16 15:11

captainblack


People also ask

Can I run Laravel without php artisan serve?

and you can run laravel without artisan. If you rename server. php and copy .

Should I use php artisan serve?

Purpose: The purpose of using Php artisan serve (PHP builtin server) is just for testing and easy starting your project it should not be used in real website deployment. Asset Not working: Always put your index file in public it's the beauty and security of Laravel framework and your assets will always working.

Where does php artisan serve run?

In Laravel, we can run Laravel Development server by typing php artisan serve command on terminal or command line. Make sure your in Laravel's project root directory. If not change your present working directory.


1 Answers

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.

like image 69
Antonio Carlos Ribeiro Avatar answered Sep 29 '22 12:09

Antonio Carlos Ribeiro