How do we set a custom port for test server?
通常当我们这样做的时候
php artisan serve
the folder gets served as :
localhost:8000
How do could we access one folder as:
localhost:8080
我想在本地主机上访问两个不同的开发站点.
How do we set a custom port for test server?
通常当我们这样做的时候
php artisan serve
the folder gets served as :
localhost:8000
How do could we access one folder as:
localhost:8080
我想在本地主机上访问两个不同的开发站点.
只需将其作为参数传递:
php artisan serve --port=8080
You may also bind to a specific host by:
php artisan serve --host=0.0.0.0 --port=8080
或者(对于Laravel 6+),您可以通过在应用程序中设置服务器端口和服务器主机来提供默认设置.环境文件.您可能还需要执行php artisan cache:clear.(感谢@mohd samgan khan)
And if you want to run it on port 80, you probably need to sudo.