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

cverster's avatar

Issues with running PHP / laravel in WSL for Windows (load times)

The initial load times for my sites are really long (3 min +) if I run them on localhost.

I'm not sure why this issue is arising, and after reading up about it online there seem to be quite a few suggestions as to how to potentially resolve it, so here is what I have tried without success:

  1. I've run ```tracert localhost`` and found no additional hops back to localhost
  2. I've checked that there is no xdebug related stuff in my php.ini file
  3. My files are not in /mnt, but directly on my linux file system (I still think there is an issue, because PHPStorm takes forever to index and does so continuously)
  4. I'm not using docker

Does anyone know what this could be?

0 likes
2 replies
cverster's avatar

Additionally, I've added exclusions to Windows Defender and tried switching off firewalls, no change.

cverster's avatar
cverster
OP
Best Answer
Level 6

For anyone else who really struggled with this, it turned out to be MySQL's performance on WSL2. By running the atop command, I could see that MySQL was using 100% - 150% of my CPU.

I managed to resolve this by installing Docker and running a docker instance of MySQL instead to which I connected my laravel application.

Please or to participate in this conversation.