How to Run Laravel Project on Different Port?

Here, I will show you how to run the laravel project on different port. you’ll learn run laravel project on different port . Here you will learn laravel run project on different port. This post will give you a simple example of php artisan serve –port. Alright, let’s dive into the steps.

We can run the laravel project using “php artisan serve” command. It will use by default 8000 port to run the laravel app. But you want to run laravel project on a different port then the artisan command provides an option called “–port” and you can run the laravel app in a different port.

So, let’s see below the commands to run the laravel app with different ports. you can use a different port to laravel 6, laravel 7, laravel 8 and laravel 9 versions as well.

Run Laravel Project Command:

php artisan serve

.medrectangle-3-multi-157{border:none!important;display:block!important;float:none;line-height:0;margin-bottom:15px!important;margin-left:0!important;margin-right:0!important;margin-top:15px!important;max-width:100%!important;min-height:250px;min-width:300px;padding:0;text-align:center!important}

URL:

http://localhost:8000

Run Laravel Project with Different Port Command:

php artisan serve --port=8080

URL:

http://localhost:8080

Run Laravel Project with Different Port and Host Command:

php artisan serve --host=localhost --port=8080

URL:

http://localhost:8080

I hope it can help you…

Leave a Comment