php-shellcommand icon indicating copy to clipboard operation
php-shellcommand copied to clipboard

proc_open hangs - for few options (--orientation "landscape")

Open sujith-entreda opened this issue 2 years ago • 1 comments

$this->_stdErr = stream_get_contents($pipes[2]); $this->_stdOut = stream_get_contents($pipes[1]);

Environment: Windows XAMPP

Have to swap these two lines, https://stackoverflow.com/questions/31194152/proc-open-hangs-when-trying-to-read-from-a-stream

sujith-entreda avatar Dec 02 '22 09:12 sujith-entreda

There's some history to the current code: your change was suggested before in #20 and lead to new problems in #21. So I'm a bit hesitant to ever change this again.

On the other hand #20 resulted in a big rewrite of proc_open() in non-blocking mode which fixed most of the hanging issues. It is not an option on windows systems but most developers probably use Linux anyway and will not be affected by the change.

So we could probably give this change a try - but I already see more new issues popping up complaining that things now don't work as before on Windows.

Sidenote: I know it's provocative but IMO switching to Linux for development or using Docker to run PHP would save you a lot of pain. In my experience PHP and Windows never were friends.

mikehaertl avatar Dec 02 '22 09:12 mikehaertl