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

Sturm's avatar
Level 5

`php artisan serve` lies?

I just created a brand-new Laravel project, added Breeze, and tried running php artisan serve. I am told that the app can be accessed via two URLs:

vite's php artisan serve

However, I cannot access it via either of those URLs. I can access it at http://localhost:8000/, though. Why not 3000, as in that screenshot? Why not the hostname in that screenshot?

0 likes
7 replies
thinkverse's avatar
Level 15

http://localhost:3000 is a development server started by Vite to serve your assets like CSS and JavaScript, and is started when running npm run dev.

The APP_URL displayed is the URL set in your .env file, the default APP_URL is auto-generated to match the folder name and ends with .test for Laravel Valet since that is the TLD Valet uses. It won't be accessible if you're serving via artisan serve and if you're using artisan serve for your development I'd recommend changing the APP_URL to match http://localhost:8000 instead.

1 like
Sturm's avatar
Level 5

Sorry, I was clearly getting confused between Vite (npm run dev), artisan serve, and Sail. I know it's great to have options, but now I'm confused about which I should run!

Okay, so Vite is just for bundling assets; not a web server. So it's down to artisan serve and Sail. Or, for that matter, I could even use a third-party stack like Laragon, XAMPP, etc. Hmmm, I'll have to give it some thought. And I guess it might help to know what the final destination of this web app will be. I'm guessing I'll either create a Digital Ocean droplet (which I've done before) or I might explore AWS lambda for the first time.

Regardless, thanks for teaching me which does which, @thinkverse!

thinkverse's avatar

@Sturm ooh, might only be Valet that uses .test. I don't use Sail myself so I'm not that familiar with it. 🙂

Sinnbeck's avatar

@Sturm what os are you running? Then we can better suggest a good dev environment for you

Sturm's avatar
Level 5

@Sinnbeck I'm using Windows 11 and WSL2 with Ubuntu. And I typically use PhpStorm.

Please or to participate in this conversation.