php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26905 exec malfunction during error redirection
Submitted: 2004-01-14 12:05 UTC Modified: 2004-01-15 01:12 UTC
From: mbanefo_barbara at NOSPAM dot yahoo dot fr Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.2.1 OS: HP UX
Private report: No CVE-ID: None
 [2004-01-14 12:05 UTC] mbanefo_barbara at NOSPAM dot yahoo dot fr
Description:
------------
Help !

The exec command (see code below) produces unexpected results on my system ( PHP 4.2.1 with an Apache/1.3.24 Server on a HP-UX )

Do you have a solution for this ?

Barbara

Reproduce code:
---------------
<?php
error_reporting(E_ALL);
$cmd = "mkdir toto" ;
echo "<br><pre>";	
$err=exec("$cmd 2>&1");	
echo $err;
echo "</pre>";
?>

Expected result:
----------------
First run : 
 empty result

Successive runs :
 mkdir: cannot create toto: File exists



Actual result:
--------------
When safe Mode is enabled :
This creates 2 directories : "toto" and "2>&1"
No errors are reported

When safe-mode is disabled, the program gives the expected result

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-15 01:12 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC