Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run laravel 5 on port 80 of localhost?

For previous versions of Laravel, you can simply download laravel with composer in the root folder of your apache server and type in http://localhost/public/ to see the "You've arrived" homepage.

I know I can use php artisan serve to view the Laravel5 default home page, but it is run on localhost:8000 and I heard that php artisan serve command should not be used in production due to the limit of connection and the bad performance. Is there a way I can see the default home page without using the php artisan serve command?

And it is really frustrating that Laravel is not including such simple thing in their installation documentation....

like image 572
cytsunny Avatar asked Apr 12 '15 17:04

cytsunny


People also ask

How do I run a Laravel project on a specific port?

We can run the laravel project using "php artisan serve" command. It will use by default 8000 port to run the laravel app. But you want to run laravel project on a different port then the artisan command provides an option called "--port" and you can run the laravel app in a different port.

Which port is Laravel running on?

The default port of the Laravel WebSocket server is 6001 . You may pass a different port to the command using the --port option. This will start listening on port 3030 .


1 Answers

To run the service on another port you need to pass the port parameter with port numberusing this code on the cmd:

php artisan serve --port=80

To run on port 80, you might need administrator permission.

like image 74
mininoz Avatar answered Sep 19 '22 07:09

mininoz