|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8466 Return status of executed command not passed correct in Exec() and System()
Submitted: 2000-12-28 17:29 UTC Modified: 2001-02-22 18:40 UTC
From: kent dot hansen at bigfoot dot com Assigned:
Status: Closed Package: Program Execution
PHP Version: 4.0.4 OS: Linux (RedHat 6.2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 - 47 = ?
Subscribe to this entry?

 [2000-12-28 17:29 UTC] kent dot hansen at bigfoot dot 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:


 exec ("ls /", $array, $rc);
 echo "return value: $rc<br>";
 echo "output:<br>";

 for ($i=0; $i<$rows; $i++) {
  echo $array[$i]."<br>";

The output is:

return value: -1

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-22 05:19 UTC]
seems to be dup of #8992
 [2001-02-22 18:40 UTC]
Fixed in CVS.


PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 20:01:29 2024 UTC