How to run laravel 5 on port 80 of localhost?

安稳与你 提交于 2019-11-30 16:59:02

问题


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....


回答1:


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.




回答2:


You may have to use sudo command for admin rights.

sudo php artisan serve --port=80 


来源:https://stackoverflow.com/questions/29592441/how-to-run-laravel-5-on-port-80-of-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!