You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to #68. I took a deeper look at 'Nginx'. It first binds to an IPv4 address and then to an IPv6 address (to the same port by default) using the IPV6_V6ONLY option. Unfortunately, we are not able to support the scenario immediately and we have a bug tracking this.
As an alternative, there are couple of options as workarounds:
Edit the default configuration of Nginx to start at different ports on IPv4 and IPv6. Or, use either IPv4 or IPv6. The port configuration for Nginx is stored in '/etc/nginx/sites-enabled/default'. I was able to verify that both these workarounds work and the Nginx server starts successfully on build 14342. We know its not ideal, but at least gets your one step further.
Meanwhile, we have an understanding of the bug on our side, but unfortunately, it might take some time to fix it because of dependencies outside of WSL.
Add the following line to /etc/nginx/nginx.conf: master_process off;
Then restart nginx: sudo service nginx restart;
Edit:
This appears to only get nginx working for html files. When trying to load php files through php-fpm I receive the following error: 2016/06/30 15:28:14 [alert] 458#0: *1 connect() failed (22: Invalid argument) while connecting to upstream, client: 127.0.0.1, server: REMOVED, request: "GET /REMOVED HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "REMOVED", referrer: "REMOVED"
Reacted by Tim Nash, magic, likun123687, Michael Davidson, Dan Ruddy Watts and panjianom
After adding signal driven IO support for unix stream sockets, I was able to run nginx locally and load the default site. Also confirmed that the errors were gone from the nginx error log. The fix should be out in insider builds soon.
Can you please confirm if the issues with php are resolved?
Sunil Muthuswamy (@sunilmut) I wasn't providing an issue. I'm just curious if dvaknheo has tested performance with the latest Insider build as I'm not able to install Insider builds. I don't normally work with nginx but do play slightly with php. I brought the article up as a case of eventually having a possible performance boost for utilizing Unix sockets vice tcp ports which is currently done in some situations such as using nginx
Nikita Ushakov (@DarthSpock) - Got it, thanks! A forward looking statement, but theoretically speaking (without any measurements), the way things are currently implemented and layered, I would not expect a difference in performance between WSL<->Win32 between TCP loopback and AF_UNIX sockets. Note that this is just in theory.
2018/01/21 00:29:22 [emerg] 35#35: io_setup() failed (38: Function not implemented)
Open a new one for that following CONTRIBUTING.md. Cant tell you if it is a dupe or not because not enough information provided. This issue (bind() to 0.0.0.0:81 failed (22: Invalid argument) was closed a long time ago along with #68.
yesterday night I upgrade unbuntu (for i want a php7.1 - swoole project). and then my php(both php7.0 and another download php7.2) is broken :(
ERROR: failed to retrieve TCP_INFO for socket: Protocol not available (92)
ERROR: pid 1031, fpm_socket_get_listening_queue(), line 420: failed to retrieve TCP_INFO for socket: Protocol not available (92)
again! ,thought ,i set socket bind to 127.0.0.1:8999 .
maybe ,my win10 need to upgrade 1803ver
////
some month last i install Tencent WeGame and broken my WSL thought I re-install wsl can not solute. then I uninstall WeGame soluted .
but this days my php is not broken , just after upgrade unbuntu .
This configuration works in Ubuntu WSL.
Please note that fastcgi_buffering is off.
Without this nginx will wait on PHP forever and never complete.
location~\.php$ {proxy_set_header X-Forwarded-Proto $scheme;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;fastcgi_indexindex.php;include fastcgi_params;fastcgi_buffering off; # This must be here for WSL as of 11/28/2018fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PHP_VALUE "upload_max_filesize = 20M \n post_max_size=21M";include /etc/nginx/fastcgi.conf;}
Reacted by mojia7, Konstantin Deryabin, dvaknheo, Young Ziyi, DianWoung, wintrue, Do Manh Quan, Vuong, clark-wang, Barys Yakavita and 10 more
Reacted by wintrue, wlegend08 and Leandro Hermes Neto
Reacted by Philip Ross, Young Ziyi, wintrue, wlegend08 and Leandro Hermes Neto
Reacted by wlegend08, Ian Rocha and Leandro Hermes Neto
This configuration works in Ubuntu WSL.
Please note that fastcgi_buffering is off.
Without this nginx will wait on PHP forever and never complete.
location~\.php$ {proxy_set_header X-Forwarded-Proto $scheme;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;fastcgi_indexindex.php;include fastcgi_params;fastcgi_buffering off; # This must be here for WSL as of 11/28/2018fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}
```> fastcgi_param PHP_VALUE "upload_max_filesize = 20M \n post_max_size=21M";include /etc/nginx/fastcgi.conf;
It works for me. It was nearly two weeks that I was involved with this issue! Thanks a lot.
Activity
sunilmut commentedon May 19, 2016
This is related to #68. I took a deeper look at 'Nginx'. It first binds to an IPv4 address and then to an IPv6 address (to the same port by default) using the IPV6_V6ONLY option. Unfortunately, we are not able to support the scenario immediately and we have a bug tracking this.
As an alternative, there are couple of options as workarounds:
Edit the default configuration of Nginx to start at different ports on IPv4 and IPv6. Or, use either IPv4 or IPv6. The port configuration for Nginx is stored in '/etc/nginx/sites-enabled/default'. I was able to verify that both these workarounds work and the Nginx server starts successfully on build 14342. We know its not ideal, but at least gets your one step further.
Meanwhile, we have an understanding of the bug on our side, but unfortunately, it might take some time to fix it because of dependencies outside of WSL.
heyanlong commentedon May 20, 2016
Nginx server starts successfully on build 14342.
But the process will not start work
error.log
cjgreen commentedon Jun 29, 2016
As mentioned in the following blog post here:
Add the following line to /etc/nginx/nginx.conf:
master_process off;Then restart nginx:
sudo service nginx restart;Edit:
This appears to only get nginx working for html files. When trying to load php files through php-fpm I receive the following error:
2016/06/30 15:28:14 [alert] 458#0: *1 connect() failed (22: Invalid argument) while connecting to upstream, client: 127.0.0.1, server: REMOVED, request: "GET /REMOVED HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "REMOVED", referrer: "REMOVED"williamn commentedon Jun 30, 2016
I follow the steps taken as the blog post describe and it works. My nginx is now working.
But I have not successful on FPM
I got this when try to start the PHP FPM
ERROR: failed to retrieve TCP_INFO for socket: Invalid argumentAny idea why?
sunilmut commentedon Jul 5, 2016
TCP_INFO socket option is currently not supported in WSL, and something we will look into adding. Thanks for the feedback and trying out WSL!
PeterDraex commentedon Jul 26, 2016
How can I prevent FPM from using TCP_INFO socket option? Thanks. Sunil Muthuswamy (@sunilmut) William (@williamn)
loutian commentedon Aug 5, 2016
Chris Green (@cjgreen) I got the same error, did you solved it ?
spagu commentedon Nov 22, 2016
any solution so far?
heyanlong commentedon Nov 22, 2016
Mona Lisa (@spagu) i'm not retry
stehufntdev commentedon Jan 19, 2017
After adding signal driven IO support for unix stream sockets, I was able to run nginx locally and load the default site. Also confirmed that the errors were gone from the nginx error log. The fix should be out in insider builds soon.
Can you please confirm if the issues with php are resolved?
14 remaining items
WSLUser commentedon Jan 4, 2018
Sunil Muthuswamy (@sunilmut) I wasn't providing an issue. I'm just curious if dvaknheo has tested performance with the latest Insider build as I'm not able to install Insider builds. I don't normally work with nginx but do play slightly with php. I brought the article up as a case of eventually having a possible performance boost for utilizing Unix sockets vice tcp ports which is currently done in some situations such as using nginx
sunilmut commentedon Jan 4, 2018
Nikita Ushakov (@DarthSpock) - Got it, thanks! A forward looking statement, but theoretically speaking (without any measurements), the way things are currently implemented and layered, I would not expect a difference in performance between WSL<->Win32 between TCP loopback and AF_UNIX sockets. Note that this is just in theory.
CMYK99 commentedon Jan 20, 2018
In nginx error log there is such an error message.
2018/01/21 00:29:22 [emerg] 35#35: io_setup() failed (38: Function not implemented)therealkenc commentedon Jan 20, 2018
Open a new one for that following CONTRIBUTING.md. Cant tell you if it is a dupe or not because not enough information provided. This issue (
bind() to 0.0.0.0:81 failed (22: Invalid argument)was closed a long time ago along with #68.sunilmut commentedon Jan 22, 2018
@YouHeng1 - Yes, please open a new issue for this and also note any functionality issue that you might be observing with nginx.
dvaknheo commentedon Aug 27, 2018
yesterday night I upgrade unbuntu (for i want a php7.1 - swoole project). and then my php(both php7.0 and another download php7.2) is broken :(
ERROR: failed to retrieve TCP_INFO for socket: Protocol not available (92)
ERROR: pid 1031, fpm_socket_get_listening_queue(), line 420: failed to retrieve TCP_INFO for socket: Protocol not available (92)
again! ,thought ,i set socket bind to 127.0.0.1:8999 .
maybe ,my win10 need to upgrade 1803ver
////
some month last i install Tencent WeGame and broken my WSL thought I re-install wsl can not solute. then I uninstall WeGame soluted .
but this days my php is not broken , just after upgrade unbuntu .
heyanlong commentedon Aug 27, 2018
dvaknheo
多写代码,少玩游戏
Write more code, play less games
hparadiz commentedon Nov 28, 2018
This configuration works in Ubuntu WSL.
Please note that
fastcgi_bufferingisoff.Without this nginx will wait on PHP forever and never complete.
Babaktrad commentedon Dec 3, 2018
It works for me. It was nearly two weeks that I was involved with this issue! Thanks a lot.
PhillR commentedon Dec 7, 2018
Henry Paradiz (@hparadiz) Hero answer, solved a long, outstanding problem for me. Thank you!
phpcat100 commentedon Jun 2, 2019
thank you.
tawhidulIKhan commentedon Nov 25, 2019
It works! thanks Henry Paradiz (@hparadiz)