Skip to content
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

unable to set stream resource to non-blocking - PHP 7.1 stream_set_blocking doesn't work #117

Closed
berbagimadani opened this issue Oct 16, 2017 · 6 comments

Comments

@berbagimadani
Copy link

I am using
-windows 7 64 bit
-php 7.1.9

PHP fatal error: uncaugt RuntimeException: unable to set stream resource to non-blocking mode in ...../vendor/react/stream/src/WritableResourceStream.php:34

look here, "stream_set_blocking doesn't work"
https://raw.githubusercontent.com/php/php-src/PHP-7.1/NEWS

please help. Thank you

@clue
Copy link
Member

clue commented Oct 16, 2017

Hi @berbagimadani! I'm not sure I follow what you're trying to do and what your issue is, as it's a bit unclear what you're trying to achieve from the description you've posted.

May I ask you provide a simple gist of what you're trying to achieve? Thanks!

Your referenced PHP changelog only links to https://bugs.php.net/bug.php?id=72853 which leads to php/php-src@abe0090 which is a minor fix in PHP 7.0.11 and only affects stream_get_meta_data() which does not appear to be relevant here.

Given you're using Windows, it looks like you may be affected by #46 and/or reactphp/child-process#41 instead.

@berbagimadani
Copy link
Author

Thankyou for reply,
i am using -windows 7 64bit -php 7.1.9
when i run code example "cat.php" here there is an error.
writable-stream-error

I want no errors like the picture above

Thank's

@clue
Copy link
Member

clue commented Oct 17, 2017

Yes, this is a known issue for Windows only and is covered in our README.

Windows does not offer an API to read from console input without blocking in PHP. Unfortunately, until https://bugs.php.net/bug.php?id=47918 is addressed (which is unlikely to happen any time soon), there's nothing we could do to work around this (#46).

In order to avoid this issue: Simply don't read from console input on Windows (for example clue/psocksd@c2f2f90),

I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍

@merovinh
Copy link

merovinh commented Nov 20, 2019

Have the same issue on Centos 7
PHP Fatal error: Uncaught RuntimeException: Unable to set stream resource to non-blocking mode in .../vendor/react/stream/src/WritableResourceStream.php:35

PHP 7.2.14

@clue
Copy link
Member

clue commented Nov 20, 2019

@merovinh We're not aware of any such limitations except for process pipes on Windows. Can you create a new issue with some steps to reproduce the problem you're seeing? 👍

@merovinh
Copy link

@clue I created an issue with example here Kucoin/kucoin-php-sdk#68

kucoin-php-sdk dependencies uses reactphp, and the problem somewhere there. Unfortunately I can't create example independent of third party.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants