Laravel

Run laravel project on different port

Hello buddy, I hope you are doing well in this article we will learn about how we can run laravel projects on different ports.

Sometimes it is required to run multiple laravel project at the same time, for example in the case of a project which uses API as a backend. We mostly use PHP artisan serve to run the project in the development mode but by default, it captures 8000 port.

So in this post, you will learn how to overcome this issue and we will run the multiple laravel project at the same time in the development mode by using a different port.

Basic Laravel project command

php artisan serve

When you run the above command your project can be accessible with the below URL

http://localhost:8000/

Run Laravel Project on different port command

php artisan serve --port=8080

when you run the above different port commands, the project will be accessible on the below URL

http://localhost:8080/

Run Laravel Project with Different Port and Host Command:

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

When you use the above command the host is also in your control, which means you can decide which host will use the port. Your project will accessible with the below URL

http://localhost:8080/

Note: All the above commands will be run from the project root folder.

I hope your issue with running laravel project on different will ends here, if you have the question feel free to comment, we will try to reply you back as soon as possible.

Don’t forget to rate our blog, helps other to understand blog quality.

Shaiv Roy

Hy Myself shaiv roy, I am a passionate blogger and love to share ideas among people, I am having good experience with laravel, vue js, react, flutter and doing website and app development work from last 7 years.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button