How to set port for php artisan.php serve in Laravel?

0 votes

Hello,

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.How to do that?

Thank You!

Mar 30 in Laravel by kartik
• 11,290 points
154 views

1 answer to this question.

0 votes

Hii @kartik,

When we use the

php artisan serve 

it will start with the default HTTP-server port mostly it will be 8000 when we want to run the more site in the localhost we have to change the port. Just add the --port argument:

php artisan serve --port=8081

enter image description here

Hope this works!!

Thank you!

answered Mar 30 by Niroj
• 22,790 points

Related Questions In Laravel

0 votes
1 answer

How to echo to console in Laravel and Artisan?

Hello @kartik, You can try this as this ...READ MORE

answered Apr 3 in Laravel by Niroj
• 22,790 points
34 views
0 votes
1 answer

How to install all required PHP extensions for Laravel?

Hello, Laravel Server Requirements mentions that BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer and XML extensions are required. Most the ...READ MORE

answered Apr 6 in Laravel by Niroj
• 22,790 points
312 views
0 votes
1 answer

How to break a for each loop in laravel blade view?

Hello @kartik, By default, blade doesn't have @break and @continue which are ...READ MORE

answered Apr 6 in Laravel by Niroj
• 22,790 points
201 views
0 votes
1 answer

How to load blade or php content into a view via ajax/jquery in laravel?

Hello @kartik, Assuming you're using jQuery... create a route ...READ MORE

answered Apr 14 in Laravel by Niroj
• 22,790 points
297 views
0 votes
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,790 points
434 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,790 points
62 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 22,790 points
64 views
0 votes
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 22,790 points
151 views
0 votes
1 answer

.How to turn off CSRF protection for a particular route in Laravel?

Hey, We can add that particular URL or ...READ MORE

answered Mar 24 in Laravel by Niroj
• 22,790 points
86 views
0 votes
1 answer

How to get distinct values for non-key column fields in Laravel?

Hello @kartik In eloquent you can use this $users ...READ MORE

answered Mar 30 in Laravel by Niroj
• 22,790 points
577 views