php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #491 Can't get rid of file system error message when file doesn't exist
Submitted: 1998-06-29 10:26 UTC Modified: 1998-06-29 13:27 UTC
From: khapeman at skidmore dot edu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Final Release OS: Solaris 2.5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: khapeman at skidmore dot edu
New email:
PHP Version: OS:

 

 [1998-06-29 10:26 UTC] khapeman at skidmore dot edu
<H1>File Error Message Test</H1>
<?
$cmd = "ls dir/transactions1/junk.170_*";
$tst = @exec($cmd);
?>

This produces the following message before the heading is displayed:

dir/transactions1/junk.170_*: No such file or directory 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-29 13:27 UTC] zeev
ls writes to stderr, which isn't piped by popen(), which
results in this behavior.  There's nothing you can do about
it at the PHP level.

You can, however, ask the shell to do the job for you,
by doing something like:

$tst = @exec("ls dir/transactions1/junk.170_* 2> /dev/null");

which tells sh to redirect all stderr output to /dev/null.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 09:01:34 2025 UTC