PHP7.0-fpm extremly slow on Ubuntu Windows Subsystem Linux

Using windows 10 v1803, and nginx & php7 fpm via WSL.

Changing listen to 127.0.0.1:9000 doesn't work for me.

After spending hours of googling, I found: https://github.com/Microsoft/WSL/issues/2100

i.e. Add

fastcgi_buffering off;

to nginx.conf, and save my day.


Sorted this out, pasting for any other enthusiast working with ubuntu on windows subsystem.

The default Nginx and php setups are going to use a unix:socket, but that’s not going to work for WSL. Also, WSL uses a lightweight init system and services are not going to start automatically for Nginx, PHP, MySQL, etc.


Edit /etc/nginx/sites-available/example.com.conf

comment out fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

and add fastcgi_pass 127.0.0.1:9000;


Edit /etc/php/7.0/fpm/pool.d/www.conf

comment out listen = /var/run/php/php7.0-fpm.sock;

and add listen = 127.0.0.1:9000;


It will fix all of your issues.