Bug #72515 [Fbk->NoF]: Proc_open does not work with sockets
| From: | php-bugs at lists dot php dot net | Date: | Sun, 10 Jul 2016 04:22:40 +0000 |
| Subject: | Bug #72515 [Fbk->NoF]: Proc_open does not work with sockets | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202165@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72515&edit=1
ID: 72515
Updated by: php-bugs@lists.php.net
Reported by: Anatolii_Ivaniuk_CW at bmc dot com
Summary: Proc_open does not work with sockets
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Streams related
Operating System: Windows
PHP Version: 5.5.37
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2016-07-01 15:53:06] ab@php.net
Thanks for the report. I'm currently unable to reproduce the issue with the latest 7.0 tree.
The code seems correct, but i guess you should use PHP_BINARY instead of php.exe hardcoded. Anyway,
could you please give some further info on how to reproduce?
Thanks.
------------------------------------------------------------------------
[2016-06-29 10:15:47] Anatolii_Ivaniuk_CW at bmc dot com
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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72515&edit=1