ID: 44994 Updated by: garre...@php.net Reported By: dbarrett at vistaprint dot com Status: Assigned Bug Type: Program Execution Operating System: win32 only - 2003 Server, 64-bit PHP Version: 5.2.6 Assigned To: garretts New Comment:
I've seen this happen in other languages too. This happens when the pipe between the parent and child fills up, and cmd.exe ends up blocking and creates a race condition. (Windows script host languages trip up on this quickly) in popen_ex() ( in tsrm_win32.c) the pipe is creates with a 2k buffer: if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) { this should probably be significantly larger. I'd certainly go with at least 16k or 32k. (hey, it's only memory :D) as well, the elimination of the unrequired cmd.exe as the immediate child process would eliminate the possibility that *it's* buffer gets overwhelmed too. (which solves bug #43327, and I've passed a patch to Pierre for that.) Previous Comments: ------------------------------------------------------------------------ [2009-06-08 16:40:15] alex at bartl dot net Reproducable with PHP 5.2.9-1 on Windows2003 Server with Apache2.2 Workaround with calling session_write_close() before calling exec() confirmed working NOT reproducable with PHP 5.2.1 on Windows 2000 Server with IIS5 anyway, seems to be a duplicate of Bug#44942 ------------------------------------------------------------------------ [2009-05-04 14:56:29] mk1992 at hotmail dot com same problem here, php 5.2.9, w2k3, IIS: shell_exec hanging on production server but not on development server. Can't do downgrade to 5.1.x. ------------------------------------------------------------------------ [2009-04-28 22:52:53] diackne at gmail dot com I have the same issue in windows 2008 web server iis 7 !!! ------------------------------------------------------------------------ [2009-04-22 02:03:38] aliks0905 at gmail dot com I have the same issue as well. I use the exec() function to simultaneously upload files and sometimes cmd.exe freezes and all following uploads fail. I run on a Windows 2003 Server using Apache 2.2.11 and PHP 5.2.9 Looking forward to hearing a solution. ------------------------------------------------------------------------ [2009-02-27 18:58:20] alex at alexi dot ch Hi all, I can fully confirm the above behaviour on the Windows platform. We are using Apache FOP to create PDF-Files out of PHP, so we are invoking exec() to start the command line FOP processor. With several versions of PHP 5.2.x (5.2.4, 5.2.6, 5.2.8), this problem occurs soon as more than one user is invoking the exec(). Luckily we could not reproduce this behaviour using PHP 5.1.x, so downgrading to a 5.1.x version might also be an option for you. Regards alex ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/44994 -- Edit this bug report at http://bugs.php.net/?id=44994&edit=1