|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-07-01 15:53 UTC] ab@php.net
-Status: Open
+Status: Feedback
[2016-07-01 15:53 UTC] ab@php.net
[2016-07-10 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 06:00:02 2025 UTC |
Description: ------------ Starting from version 5.5.18 proc_open with socket handles does not wait for input. Everything work fine in 5.5.17 version of php. If I open up a child process and pass in socket to handle new clients commands in 5.5.17 version script is waiting for input and prints it. But in 5.5.18 and up till 7.0.4 this approach does not work anymore for windows and works fine on linux environments. Test script: --------------- proc.php ######################################## $errno = ''; $errstr = ''; $socket = stream_socket_server("tcp://0.0.0.0:$port",$errno,$errstr); $client = @stream_socket_accept($socket,1); $handles = array( 0 => $socket, 1 => $socket, 2 => STDERR, ); $pipes = array(); $h = proc_open('php.exe file.php',$handles,$pipes); file.php ##################################### echo(">"); if (($cmd = fgets(STDIN,2048)) === false) return; $cmd = trim($cmd); echo($cmd); Expected result: ---------------- Child process can read and write to socket. Actual result: -------------- Child process terminates as $cmd = fgets(STDIN,2048) is always false.