|  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
 [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 );




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()...



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-06 05:45 UTC]
exec() != shell_exec()
 [2002-06-06 06:03 UTC]
Just FYI, I could not reporoduce this. The latest sapshot prints int(3) as it should.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 22:01:41 2021 UTC