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

PTY detection issues. #335

Closed
lyrixx opened this issue Feb 12, 2024 · 2 comments · Fixed by #337
Closed

PTY detection issues. #335

lyrixx opened this issue Feb 12, 2024 · 2 comments · Fixed by #337
Labels
bug Something isn't working kind/php-and-sapi Issues related to php source and SAPI

Comments

@lyrixx
Copy link

lyrixx commented Feb 12, 2024

Hello,

Thanks for your hard work! This is really cool.

We are integrating it to castor and be able to ship task runners as standalone lib.

But we face a strange bug with PTY:

With the static binary:

proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes)
Warning: proc_open(): PTY (pseudoterminal) not supported on this system  

Actually, my term DO supports PTY.

>…om/jolicode/castor(add-compile-command *%) php -a
Interactive shell

php > var_dump(proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes));
resource(7) of type (process)
@crazywhalecc crazywhalecc added bug Something isn't working question Further information is requested kind/php-and-sapi Issues related to php source and SAPI and removed question Further information is requested labels Feb 13, 2024
@crazywhalecc
Copy link
Owner

crazywhalecc commented Feb 13, 2024

Thanks for reporting this bug.

I just looked for the source code and found that this line of patch code was added when the event extension was added 10 months ago.

FileSystem::replaceFile(SOURCE_PATH . '/php-src/main/php_config.h', REPLACE_FILE_PREG, '/^#define HAVE_OPENPTY 1$/m', '');

This issue is related to event extension support on macOS: it will encounter openpty errors when compiling event extensions on macOS.

After removing this line, openpty just works. I will fix this. Bugs in the Event extension on macOS will be documented.

@crazywhalecc
Copy link
Owner

Warning: proc_open(): PTY (pseudoterminal) not supported on this system  

The problem with PTY not being supported has been fixed, but I'm not 100% sure that solved your problem. I've merged the code into the main branch, you can test it with spc binary (nightly build) or test it with git clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/php-and-sapi Issues related to php source and SAPI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants