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, 2020 in Laravel by kartik
• 37,520 points
17,630 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, 2020 by Niroj
• 82,840 points

Related Questions In Laravel

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, 2020 in Laravel by Niroj
• 82,840 points
4,213 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, 2020 in Laravel by Niroj
• 82,840 points
22,799 views
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, 2020 in Laravel by Niroj
• 82,840 points
5,597 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, 2020 in Laravel by Niroj
• 82,840 points
22,593 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

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

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,012 views
0 votes
1 answer

What is redirection in Laravel?

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

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,995 views
0 votes
1 answer

How to install Laravel via composer?

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

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,918 views
+1 vote
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, 2020 in Laravel by Niroj
• 82,840 points
44,693 views
0 votes
1 answer

How to revert 'php artisan serve' command in laravel

Hello @kartik, Press Ctrl + Shift + ESC. Locate the php process running ...READ MORE

answered Sep 28, 2020 in Laravel by Niroj
• 82,840 points
16,832 views
0 votes
1 answer

How to run laravel 5.0 project on localhost without use php artisan serve?

Hello @kartik, You need to change "server.php" to ...READ MORE

answered Oct 28, 2020 in Laravel by Niroj
• 82,840 points
2,255 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP