PHP 4.0 Bug #8466 Updated: Return status of executed command not passed correct in Exec() and System()

From: Date: Thu, 22 Feb 2001 23:40:40 +0000
Subject: PHP 4.0 Bug #8466 Updated: Return status of executed command not passed correct in Exec() and System()
Groups: php.dev 
Request: Send a blank email to php-dev+get-47297@lists.php.net to get a copy of this message
ID: 8466 Updated by: sniper Reported By: kent.hansen@bigfoot.com Old-Status: Duplicate Status: Closed Bug Type: Program Execution Assigned To: Comments: Fixed in CVS. --Jani Previous Comments: --------------------------------------------------------------------------- [2001-02-22 05:19:07] stas@php.net seems to be dup of #8992 --------------------------------------------------------------------------- [2000-12-28 17:29:17] kent.hansen@bigfoot.com The functions Exec() and System() fails to pass the return status of the command to the return_var variable. It always passes "-1". This script reproduces the bug: <?php $rc=0; unset($array); exec ("ls /", $array, $rc); echo "return value: $rc<br>"; echo "output:<br>"; $rows=count($array); for ($i=0; $i<$rows; $i++) { echo $array[$i]."<br>"; } ?> The output is: return value: -1 output: bin boot dev ...etc... The "return value" is also "-1" if I change "/" to "/dont/exists/". This bug is introduced in version 4.0.4, exec() worked in version 4.0.3pl1. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=8466&edit=2

« previous php.dev (#47297) next »