|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7287 "exec() or die", dies on success
Submitted: 2000-10-17 12:37 UTC Modified: 2000-12-07 23:59 UTC
From: seth at the-hub dot com Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.3pl1 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: seth at the-hub dot com
New email:
PHP Version: OS:


 [2000-10-17 12:37 UTC] seth at the-hub dot com
i wrote a script with something like the following:

exec("touch somefile") or die("couldnt create file!");

and it worked fine in php 4.0.1

but when i upgraded to 4.0.2 the exec kept dying even though there was no error.

when i upgraded to 4.0.3 it still did not work.

i've also tried replacing exec() with a system() call and that did not help.

note: permissions have not changed on any dirs so that's not the problem, and exec doesn't return any errors (or any output at all for that matter) into the error array or anywhere else


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-07 23:59 UTC]
This inteded function of exec.

string exec (string command [, string array [, int return_var]])

You need to test return_val which will be the error condition.


exec("touch hi",,$err); if ($err) die("Could not create file");


PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun May 31 01:01:25 2020 UTC