#44942 [Opn]: exec() hangs apache
ID: 44942 User updated by: inqualab1985 at gmail dot com Reported By: inqualab1985 at gmail dot com Status: Open Bug Type: Program Execution Operating System: Microsoft Window 2000 SP4 PHP Version: 5.2.5 New Comment: Dear markus In the first sight, I also understand that this happen only when multiple request hit the script with exec(). But in reality there is no guarantee that if the request goes one by one Hanging will not happen. I had done a test at the time of writing this bug in which call the script one by one but it randomly hanged up again after a period of time. At that time period is long. So dear PHP team , you have to really look up this matter. Thanks Previous Comments: [2008-07-03 20:33:19] markus at opahle dot com Windows XP SP3 Apache 2.2.6 PHP 5.2.6 I have the same problem. I noticed that apache only hangs up when a php script with an exec command was called twice at the same time. The problem also ocours when I tried to use popen or proc_open(with and without bypass_shell option) [2008-06-10 14:59:10] aleaddict at yahoo dot com Windows Server 2003 R2 Service Pack 1 Apache 2.2.6 PHP 5.2.4 (upgraded to 5.2.6 with no success) Executing resource kit utility shortcut.exe via exec() with EXACTLY the same results... Random, no errors logged, hangs up all succeeding calls to exec(), requires restart. Keith [2008-05-14 07:56:17] inqualab1985 at gmail dot com Dear Jani There is no problem with 'sample.exe'. I have tested the same for different exe or even for dos command. It hangs when we are calling the page at regular interval of time (through Ajax). There is a problem in the definition of exec() function. For any further information , feel free to contact me. [2008-05-09 14:20:40] [EMAIL PROTECTED] What exactly does this "sample.exe" do? It's most likely not any PHP problem at all anyway, you just call some exe that "hangs" itself.. ---- [2008-05-08 05:40:53] inqualab1985 at gmail dot com Description: Hi! PHP Team I am facing a problem of apache hang up due to exec() function. I am using PHP 5.2.5 and Apache 2.2 on MS Window 2000 SP4 & also on MS Window XP. The problem is that I have to execute a exe, for which I have use exec(). Normally it works Fine, but sometime (randomly) it hang up. It will lock the apache and if we call the same page or any other page of php having exec(), it hang up at the line where exec() function is used. If we commented the line having exec(), then the page run & loaded correctly. The problem also become critical because there is no error for this. Also none of the error handling & logging mechanism works. The only solution to this problem is to restart the Apache. I am providing you as much as information as possible to catch the problem correctly. Reproduce code: --- $exeFilePath = realpath("../sample.exe"); if (eregi("win", PHP_OS)) $command = "\"\"$exeFilePath\" argument1\""; else $command = "\"$exeFilePath\" argument1"; $output = null; $returnVal = null; $result = exec($command,$output,$returnVal); if($returnVal !=0) echo "Error"; else echo $output[0]; echo "end of the program"; Expected result: it will show the output of exe for particular argument. Actual result: -- Normally it works correctly as expected but sometime the the execution of the page hang at line "$result = exec($command,$output,$returnVal);" . After this has happen I am not able to run any script that will use the exec(). In all scripts apache hangs at exec() function, do not matter which exe will be called. -- Edit this bug report at http://bugs.php.net/?id=44942&edit=1
#44942 [Fbk->Opn]: exec() hangs apache
ID: 44942 User updated by: inqualab1985 at gmail dot com Reported By: inqualab1985 at gmail dot com -Status: Feedback +Status: Open Bug Type: Program Execution Operating System: Microsoft Window 2000 SP4 PHP Version: 5.2.5 New Comment: Dear Jani There is no problem with 'sample.exe'. I have tested the same for different exe or even for dos command. It hangs when we are calling the page at regular interval of time (through Ajax). There is a problem in the definition of exec() function. For any further information , feel free to contact me. Previous Comments: [2008-05-09 14:20:40] [EMAIL PROTECTED] What exactly does this "sample.exe" do? It's most likely not any PHP problem at all anyway, you just call some exe that "hangs" itself.. ---- [2008-05-08 05:40:53] inqualab1985 at gmail dot com Description: Hi! PHP Team I am facing a problem of apache hang up due to exec() function. I am using PHP 5.2.5 and Apache 2.2 on MS Window 2000 SP4 & also on MS Window XP. The problem is that I have to execute a exe, for which I have use exec(). Normally it works Fine, but sometime (randomly) it hang up. It will lock the apache and if we call the same page or any other page of php having exec(), it hang up at the line where exec() function is used. If we commented the line having exec(), then the page run & loaded correctly. The problem also become critical because there is no error for this. Also none of the error handling & logging mechanism works. The only solution to this problem is to restart the Apache. I am providing you as much as information as possible to catch the problem correctly. Reproduce code: --- $exeFilePath = realpath("../sample.exe"); if (eregi("win", PHP_OS)) $command = "\"\"$exeFilePath\" argument1\""; else $command = "\"$exeFilePath\" argument1"; $output = null; $returnVal = null; $result = exec($command,$output,$returnVal); if($returnVal !=0) echo "Error"; else echo $output[0]; echo "end of the program"; Expected result: it will show the output of exe for particular argument. Actual result: -- Normally it works correctly as expected but sometime the the execution of the page hang at line "$result = exec($command,$output,$returnVal);" . After this has happen I am not able to run any script that will use the exec(). In all scripts apache hangs at exec() function, do not matter which exe will be called. -- Edit this bug report at http://bugs.php.net/?id=44942&edit=1
#44942 [NEW]: exec() hang the apache
From: inqualab1985 at gmail dot com Operating system: Microsoft Window 2000 SP4 PHP version: 5.2.6 PHP Bug Type: Program Execution Bug description: exec() hang the apache Description: Hi! PHP Team I am facing a problem of apache hang up due to exec() function. I am using PHP 5.2.5 and Apache 2.2 on MS Window 2000 SP4 & also on MS Window XP. The problem is that I have to execute a exe, for which I have use exec(). Normally it works Fine, but sometime (randomly) it hang up. It will lock the apache and if we call the same page or any other page of php having exec(), it hang up at the line where exec() function is used. If we commented the line having exec(), then the page run & loaded correctly. The problem also become critical because there is no error for this. Also none of the error handling & logging mechanism works. The only solution to this problem is to restart the Apache. I am providing you as much as information as possible to catch the problem correctly. Reproduce code: --- $exeFilePath = realpath("../sample.exe"); if (eregi("win", PHP_OS)) $command = "\"\"$exeFilePath\" argument1\""; else $command = "\"$exeFilePath\" argument1"; $output = null; $returnVal = null; $result = exec($command,$output,$returnVal); if($returnVal !=0) echo "Error"; else echo $output[0]; echo "end of the program"; Expected result: it will show the output of exe for particular argument. Actual result: -- Normally it works correctly as expected but sometime the the execution of the page hang at line "$result = exec($command,$output,$returnVal);" . After this has happen I am not able to run any script that will use the exec(). In all scripts apache hangs at exec() function, do not matter which exe will be called. -- Edit bug report at http://bugs.php.net/?id=44942&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44942&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44942&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44942&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44942&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44942&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44942&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=44942&r=needscript Try newer version:http://bugs.php.net/fix.php?id=44942&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44942&r=support Expected behavior:http://bugs.php.net/fix.php?id=44942&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44942&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44942&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44942&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44942&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44942&r=dst IIS Stability:http://bugs.php.net/fix.php?id=44942&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44942&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44942&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44942&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=44942&r=mysqlcfg
#26084 [Com]: exec() hangs
ID: 26084 Comment by: inqualab1985 at gmail dot com Reported By: karolls at tlen dot pl Status: No Feedback Bug Type: Program Execution Operating System: Windows XP PHP Version: 4.3.3 New Comment: Hi! PHP Team I am also facing the same problem with exec(). I am using php 5.2.5 and apache 2.2 on window server 2003. The problem is that I have to execute a exe, for which I have use exec(). Normally it works Fine, but sometime ( more correctly, we say randomly) it hang up. It will lock the apache and if we call the same page or any other page of php having exec(), it hang up at the line where exec() function is used. If we commented the line having exec(), then the page run & loaded correctly. The problem also become critical because none of the error is shown. Also none of the error handling & logging mechanism works. The only solution to this problem is to restart the Apache. I hope you will soon solved this bug. Although, this bug is not reported by many people because most of the people works on websites thats runs on hired server where administrator already stop the execution of these functions. But the professionals working at high level on PHP experience the same problem which means there is a bug related to this class of functions. For any further information you can contact me. Thanks. Previous Comments: [2006-09-21 06:59:08] sbattula at inmage dot net I am also facing the same problem with Apache 2.0.58 and PHP 5.0.4 on Windows 2003 OS. From one of our phps, an exe called test.exe is being invoked. Randomly, Apache hangs and we need to restart it for normal operation. As sussgested in one of the php.net links (http://bugs.php.net/bug.php?id=22526), I have tried using session_write_close() before each exec call and seesion_start() after completion of the call. But this workaround does not work as suggested. [2003-11-17 18:17:06] [EMAIL PROTECTED] 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 "Open". Thank you. [2003-11-03 19:03:40] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. [2003-11-02 15:51:36] karolls at tlen dot pl Description: I'm running CGI script using the exec() function. The problem is that sometime the cmd.exe hangs. I'm shure that my CGI script is ok. I'm using PHP 4.3.3 and Apache 1.3.29 All result in the exec() command hanging until the console is manually stopped. I also have to restart Apache. I tried also other functions (system, passthru etc.) but the result is the same. -- Edit this bug report at http://bugs.php.net/?id=26084&edit=1