php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17097 exec() always reports -1- as the return value of the executed command
Submitted: 2002-05-08 10:33 UTC Modified: 2002-06-06 06:03 UTC
From: djanix at hotmail dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.0CVS-2002-05-08 OS: win32
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:
MUST BE VALID
Solve the problem:
38 + 36 = ?
Subscribe to this entry?

 
 [2002-05-08 10:33 UTC] djanix at hotmail dot com
testret.c i made... :

#include <stdio.h>
int main( int argc, char *argv[] )
{
  return atol(argv[1]);
}

compiled that into testret.exe....

test.php i made... :

<?
  exec( 'c:\testret.exe 3', $rlines, $rval );
  var_dump( $rval );
?>

outputs...

int(1)

--------------------

i've traced through the source a bunch trying to find what changed that broke it - my last build (worked fine) was from the cvs head sometime in feb - so the big changes that affect exec() are the streams.  FG(pclose_ret) is not set correctly inside of exec() - i don't feel like getting into the streams right now to find it and i assume someone on the dev team has all of that fresh in their head and can probably find this problem quickly :)

and it's obviously important since i'm sure many many people rely on exec()...

 -benjamin

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-06 05:45 UTC] sander@php.net
exec() != shell_exec()
 [2002-06-06 06:03 UTC] edink@php.net
Just FYI, I could not reporoduce this. The latest sapshot prints int(3) as it should.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC