Set port for php artisan.php serve

前提是你 提交于 2019-11-27 10:42:40

For port 8080:

 php artisan serve --port=8080

And if you want to run it on port 80, you probably need to sudo:

sudo php artisan serve --port=80

as this example you can change ip and port this works with me

php artisan serve --host=0.0.0.0 --port=8000

One can specify the port with: php artisan serve --port=8080.

Andreas' answer above was helpful in solving my problem of how to test artisan on port 80. Port 80 can be specified like the other port numbers, but regular users do not have permissions to run anything on that port.

Drop a little common sense on there and you end up with this for Linux:

sudo php artisan serve --port=80

This will allow you to test on localhost without specifying the port in your browser. You can also use this to set up a temporary demo, as I have done.

Keep in mind, however, that PHP's built in server is not designed for production. Use nginx/Apache for production.

You can use

php artisan serve --port 80

Works on Windows platform

You can use many ports together for each project,

  php artisan serve --port=8000

  php artisan serve --port=8001   

  php artisan serve --port=8002

  php artisan serve --port=8003
sudo /Applications/XAMPP/xamppfiles/bin/apachectl start

This fixed my issue AFTER ensuring my ports were all uniquely sorted out.

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