#26905 [Opn]: exec malfunction during error redirection

From: Date: Wed, 14 Jan 2004 17:10:32 +0000
Subject: #26905 [Opn]: exec malfunction during error redirection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-53322@lists.php.net to get a copy of this message
ID: 26905 User updated by: mbanefo_barbara at NOSPAM dot yahoo dot fr -Reported By: mbanefo_barbara at NOSPAM dot yahoo dot com +Reported By: mbanefo_barbara at NOSPAM dot yahoo dot fr Status: Open Bug Type: Output Control Operating System: HP UX -PHP Version: Irrelevant +PHP Version: 4.2.1 New Comment: Description: ------------ Help ! The exec command (see code below) produces unexpected results on my system ( PHP 4.2.1 with an Apache/1.3.24 Server on a HP-UX ) Do you have a solution for this ? Barbara Reproduce code: --------------- <?php error_reporting(E_ALL); $cmd = "mkdir toto" ; echo "<br><pre>"; $err=exec("$cmd 2>&1"); echo $err; echo "</pre>"; ?> Expected result: ---------------- First run : empty result Successive runs : mkdir: cannot create toto: File exists Actual result: -------------- When safe Mode is enabled : This creates 2 directories : "toto" and "2>&1" No errors are reported When safe-mode is disabled, the program gives the expected result Previous Comments: ------------------------------------------------------------------------ [2004-01-14 12:05:56] mbanefo_barbara at NOSPAM dot yahoo dot fr Description: ------------ Help ! The exec command (see code below) produces unexpected results on my system ( PHP 4.2.1 with an Apache/1.3.24 Server on a HP-UX ) Do you have a solution for this ? Barbara Reproduce code: --------------- <?php error_reporting(E_ALL); $cmd = "mkdir toto" ; echo "<br><pre>"; $err=exec("$cmd 2>&1"); echo $err; echo "</pre>"; ?> Expected result: ---------------- First run : empty result Successive runs : mkdir: cannot create toto: File exists Actual result: -------------- When safe Mode is enabled : This creates 2 directories : "toto" and "2>&1" No errors are reported When safe-mode is disabled, the program gives the expected result ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26905&edit=1

« previous php.bugs (#53322) next »