Symfony 4 extremely slow on windows Symfony 4 extremely slow on windows symfony symfony

Symfony 4 extremely slow on windows


* update *

I've found an even better solution for this problem. That is... vagrant. I know what you're thinking - "Vagrant on windows? Lol.". But here's what changed - there's now a plugin for NFS folder sync on windows. I've tested it on two win10 pc's and so far so good. It seems very stable for me, and i'm getting response times as low as 40-50 ms (except for the times when symfony is regenerating/warming cache etc of course). Composer installs, IDE synchronization & other stuff all working fine too.

Besides that i have fairly standard setup consisting of nginx and php7.2-fpm on ubuntu bionic virtualbox VM. Nothing special or optimised in any way.

If you're not in to vagrant much i still leave my older answer below for reference. Good luck and happy coding!

* // update *

Symfony has always been very poor in terms of performance on windows, at least for me anyway.

Enabling / disabling opcache / apc / xdebug, tweaking realpath or whatever can - probably - make things better, at least a little bit, but never really works in my experience. And... who on earth wants to work without a debugger? That's not a solution in my opinion.

My recommendation is to completly remove XAMPP / WAMP (or however you've installed your current php stack) and install nginx + php-fpm.

You can do it by hand - for example - or by installing WinNMP.

WinNMP is a tool very simillar to XAMPP / WAMP, but based on nginx. It comes with Nginx, PHP, MySQL and Redis.

The only downside is you have to learn how to configure nginx - if you don't know - but you should anyway. Nginx is more performant and thus - in most cases - better suited for production environment, so it may be helpful in the future.

Anyway that's the only viable solution i've found to use symfony on windows where i don't have to disable xdebug or wait ages on every refresh :)

enter image description here


  • Are you using localhost to connect to the db (or anything)? Change it to 127.0.0.1

  • JMS DI Extra bundle can do this on windows if not configured properly.

  • Others have mentioned xdebug and realpath_cache_size, those are also regular culprits.


Use built-in dev server instead of WAMP.Install dev server bundle:

composer require --dev symfony/web-server-bundle

Run server:

php bin/console server:run