-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP and nginx is not working #393
Comments
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. |
Nginx server starts successfully on build 14342. error.log 2016/05/20 03:18:24 [alert] 98#0: ioctl(FIOASYNC) failed while spawning "worker process" (22: Invalid argument)
2016/05/20 03:18:24 [alert] 98#0: ioctl(FIOASYNC) failed while spawning "worker process" (22: Invalid argument)
2016/05/20 03:18:24 [alert] 98#0: ioctl(FIOASYNC) failed while spawning "worker process" (22: Invalid argument)
2016/05/20 03:18:24 [alert] 98#0: ioctl(FIOASYNC) failed while spawning "worker process" (22: Invalid argument) |
As mentioned in the following blog post here: Add the following line to /etc/nginx/nginx.conf: Then restart nginx: Edit: |
I follow the steps taken as the blog post describe and it works. My nginx is now working. I got this when try to start the PHP FPM
Any idea why? |
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! |
@cjgreen I got the same error, did you solved it ? |
any solution so far? |
@spagu i'm not retry |
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? |
Just updated to 15019 and the PHP problem still persists. Do you have a rough idea of when/which build it will be in? |
Thanks for checking back. The fix didn't make it into the last insider build, but it should be in soon. When that happens we'll include it in the release notes and mark this thread as fixedinsider. |
Semi-success! Upgraded to 15025 and can get php7.0 and nginx to run. phpinfo(); works, but Im having a tough time getting any apps to run. Getting a lot of session writing errors:
Tried changing permissions on /var/lib/php/sessions to no avail. Going to try and point it elsewhere. |
Thanks for the update, can you please provide a strace of the failure and repro steps of what you tried? |
Funny thing is that I was checking phpinfo() for details, and it's getting cut off with a really fast timeout that I can't figure out. The error.log line from nginx is
The nginx.conf line for PHP on this site is:
It's entirely possible its just a bad config on my side somehow. Think I might nuke the WSL install and try again. |
Thanks, please let us know if you hit any other issues. If you do, a strace and repro steps will help us to narrow down the cause. |
If, like me, you're not on the insider builds but don't want your logs filling up with this:
You can set |
I take the same problem as |
I take the same problem but the port 9000 is on ~ |
solute it , do not run nginx/php7.0-fpm by manual in command line. |
err , i am wrong , |
@dvaknheo when you say port rather than unix file socket, are you referring to |
@DarthSpock - What is the problem that you are facing? Can you please post the repro steps and the output of the following command from the bash prompt The |
@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 |
@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. |
In nginx error log there is such an error message. |
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 ( |
@YouHeng1 - Yes, please open a new issue for this and also note any functionality issue that you might be observing with nginx. |
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) again! ,thought ,i set socket bind to 127.0.0.1:8999 . maybe ,my win10 need to upgrade 1803ver //// but this days my php is not broken , just after upgrade unbuntu . |
@dvaknheo |
This configuration works in Ubuntu WSL. 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_index index.php;
include fastcgi_params;
fastcgi_buffering off; # This must be here for WSL as of 11/28/2018
fastcgi_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. |
@hparadiz Hero answer, solved a long, outstanding problem for me. Thank you! |
thank you. |
It works! thanks @hparadiz |
php-fpm
ERROR: unable to bind listening socket for address 127.0.0.1:9000 Invalid argument
Nginx
bind() to 0.0.0.0:81 failed (22: Invalid argument)
by windows 10 preview 14332.rs1_release.160422
The text was updated successfully, but these errors were encountered: