Search code examples
phpurllaravel-artisanhosts

PHP artisan use domain without port number


When I serve my laravel project with php artisan serve --host=yum-yums.local, I can access the site via http://yum-yums.local:8000

My host file has 127.0.0.1 yum-yums.local

How can I access the site with just yum-yums.local please, with no port number appended?


Solution

  • 80 port is the default port number of http so you have to use this command to omit the port number:

    sudo php artisan serve --host=localhost --port=80