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