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

Calling deviceOpen hangs up the PHP process #34

Open
stollr opened this issue May 11, 2021 · 0 comments
Open

Calling deviceOpen hangs up the PHP process #34

stollr opened this issue May 11, 2021 · 0 comments

Comments

@stollr
Copy link

stollr commented May 11, 2021

I am using Linux version 4.19.0-14-amd64 and PHP 7.4 and try to access a GSM modem.

When fopen('/dev/ttyS0', 'r+b') is called within deviceOpen() method PHP is blocking and does not resume. I have searched around and found out that people who use C open serial ports with O_RDWR | O_NDELAY mode (see here).

In PHP there is an undocumented flag n, which makes fopen using non-blocking mode. Here are my sources:

When I call $serial->deviceOpen('r+bn') with the "n" flag, my code works ;-)

I hope this will help somebody.

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

No branches or pull requests

1 participant