ID: 8652
Updated by: cynic
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Duplicate
Bug Type: Program Execution
Assigned To:
Comments:
duplicate of #8466
Previous Comments:
---------------------------------------------------------------------------
[2001-01-11 07:31:37] [EMAIL PROTECTED]
<?
function run_command($command, $errmsg) {
$lastline = exec("$command 2>&1", &$lines, $rc);
if ($rc) {
print("<pre>n");
print("$errmsgnn");
print("Command : $commandnReturned : $rcnOutputn------n");
print(join("n", $lines)."nn");
}
return($rc);
}
$rc = run_command("/bin/uname -a", "Uname Failed!");
print("rc now = $rc");
?>
All the commands that I have tested (uname is just an example) have returned -1 as the
return code, even though the command has executed perfectly well. I get the same error
if I use system instead of exec. I cannot see how else to run a command and check to
see whether it failed or not.
I am using PHP RPMS downloaded from http://rpms.arvin.dk/php/ but this does not seem
like a packaging error, so I am reporting it here.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8652
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]