Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Neeraj1005's avatar

Run Laravel project using localhost Edited: using virtual host

How can I run the Laravel project using the localhost. Not the use of "php artisan serve command"? Where I have to make changes in Laravel project. Edited: using virtual host no // without public route

0 likes
10 replies
fylzero's avatar

What changes do you think you'd have to make in your Laravel project for php artisan serve to work correctly?

Your env can reference localhost and still use http://127.0.0.1:8000

1 like
jlrdw's avatar

Install xampp or laragon, bitnami, etc. Or use homestead.

tisuchi's avatar

In the localhost, you don't have to change anything. What you need to do just only install your laravel project inside the local server (i.g. Xampp or Wamp).

Once you have successfully installed and your local server is run, then you just browse the project location just like some other PHP project.

Imagine, you have stored your project C://xampp/htdocs/project-name. In that case, once you run xampp properly, then just visit http://localhost/project-name/public.

That's it.

2 likes
Neeraj1005's avatar

@tisuchi It's working, but if i don't use the public and simple put my url. Then how it is possible?

Snapey's avatar

Most of this conversation is flawed because you should only serve the public folder as the document root.

Install a web server and point it correctly to your project.

Don't use php artisan serve as it is only single threaded.

why do you want to serve the project - is it just for your own development environment?

Neeraj1005's avatar
Neeraj1005
OP
Best Answer
Level 9

@omardevm I solved this problem a month ago. The question I wan basically here without any public route at end or using virtual host like yourProjectName.test etc domain name can anything.

Edited:

solution

Note:

just go for google it for more info or you can find in also youtube

Please or to participate in this conversation.