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

SimonQ's avatar

php artisan serve serving old content on Chrome

I just created a new project and whenever I run php artisan serve to call the localhost:8000 server it seems to be pointing me to another project that I have not touched in a while.

This only seems to be happening in Chrome, it works fine on Safari and Firefox.

I have tried clearing my cache on Chrome and still can't seem to figure out what is going on.

Any help would be great!

0 likes
28 replies
goatshark's avatar

@SimonQ Just out of curiosity, have you tried loading the URL in Chrome's Incognito mode?

SimonQ's avatar

I just tried it, same result though

goatshark's avatar

Are all three of the browsers on the same machine? I'm assuming they are, but just making sure to not make assumptions.

goatshark's avatar

@SimonQ Yes, very strange indeed. All of the things I'm thinking about to suggest checking are kind of moot points since this is working in the other browsers. Vagrant files, homestead.yml, local /etc/hosts would all cause the same problem in the other browsers if the problem were in any of those. I have had the same behavior from Chrome in the past where I can't seem to get it to, you know, "move on" and take host changes. If I were the type to suggest rebooting, I would, but I'm not..... just saying. Make sure to kill any Chrome processes that are running to make sure it is completely restarted. I'm sure you've already been down that road though. I'll do some poking around here. Very strange.

SimonQ's avatar

Thanks @goatshark the first thing I did was reboot and restarted Chrome from start it still seems to be having the same issue however. It really is a pain as I mostly use Chrome for it's dev tools! haha

jlrdw's avatar

What happens if you clear the history and cache then does it work correctly?

jlrdw's avatar

You said you rebooted and restarted Chrome are you sure you completely cleared the history and cache? You could also actually delete any temporary files that Chrome creates on the computer to see if that helps something is wrong here.

SimonQ's avatar

@jlrdw It was in my original post. I clicked Clear Browsing Data under chrome://history/

What are these temporary files you're suggesting that Chrome creates?

jlrdw's avatar

Under more tools clear browsing data.

jlrdw's avatar

See previous reply plus I forgot to mention clear since the beginning of time not just the past hour which is default.

goatshark's avatar

@SimonQ Have you tried harsh language? I sometimes find that name calling and threats help. Kidding, of course (but not really). I'm still digging around here.

jlrdw's avatar

Did you clear from the beginning of time in the drop-down like my above reply?

jlrdw's avatar

There's an option somewhere in chrome to disable cache try that.

goatshark's avatar

@jlrdw: I was thinking of the disable cache thing too, but then I thought the incognito mode should take care of any caching concerns.

@SimonQ: Oh, you didn't come off as harsh. I was just injecting some (unhelpful) wise-ass commentary. Still looking here too. :)

jlrdw's avatar

This is a puzzler. Have you tried updating Chrome to the latest version? Let me add that I have seen a lot of problems with chrome mentioned on the forum? But I do like the development tools in Chrome. Also search Google for this maybe there's a known issue not corrected yet.

goatshark's avatar

I know this is really reaching, but have you tried to serving it up on something other than 8000? If the problem is Chrome being insubordinate, maybe changing the port is enough for it to actually 'get' the new site instead of pulling whatever it has from cache (not that we've proven it's coming from cache, quite the opposite I think). Might not be helpful, but it's easy enough to test.

SimonQ's avatar

@jlrdw I'm on the latest version of Chrome

@goatshark I just tried to do it on port 8001 and 8080 but I am getting a new error: This site can't be reached localhost refused to connect.

I tested this on different browsers, Safari and Firefox seems to be ok but not Chrome...

goatshark's avatar

@SimonQ I found something similar reported here: http://stackoverflow.com/questions/32171725/chrome-cant-open-localhost3000-with-gulp-browsersync

Now, this does not even begin to explain the root cause, but might be worth trying. Commenting out the IPv6 hosts file entry for localhost should have absolutely nothing to do with they symptoms you're experiencing, but since we're swinging around in the dark here, it might be worth a try for testing purposes if nothing else.

goatshark's avatar

And actually, while you're in the /etc/hosts file, make sure there is an entry for localhost to resolve to 127.0.0.1. Maybe non-chrome browsers are being helpful (and reasonable) and assuming localhost is, well, localhost(127.0.0.1). If you don't have an entry in there for this, perhaps Chrome is just being a pedantic b*tch.

SimonQ's avatar

Chrome is just being a big pain now... just tried changing what you suggested through the link and still the same thing @goatshark

SimonQ's avatar

Hmm, it says the server can't be reached now.Can't connect to the server "127.0.0.1".

I'm also receiving a "This site can't be reached" on Chrome as well when I visit localhost:8000... I didn't change anything either since yesterday

Please or to participate in this conversation.