Set port for php artisan.php serve

maan81 picture maan81 · Aug 1, 2013 · Viewed 193.4k times · Source

How do we set a custom port for test server?

Normally when we do

php artisan serve

the folder gets served as :

localhost:8000

How do could we access one folder as:

localhost:8080

I want to access two different development sites on my localhost.

Answer

Andreas Bergström picture Andreas Bergström · Nov 13, 2013

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