|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29612 Variable $php_errormsg disappears
Submitted: 2004-08-11 13:28 UTC Modified: 2004-08-28 20:28 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: tom at bitworks dot de Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.3.8 OS: Debian woody Apache/1.3.27 (Unix
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:
Solve the problem:
18 + 40 = ?
Subscribe to this entry?

 [2004-08-11 13:28 UTC] tom at bitworks dot de
Searching for the behavior of all file functions and the right locking mechanisms I tried to use fopen(filename,xb) with former umask(0222). That was intended to trigger an error and look into $php_errormsg

But $php_errormsg was disappeared

Reproduce code:
$dateiname = 'opentest123.txt';
$mask = umask(0222);
echo "<br />Mask: $mask<br />";
$fh = fopen($dateiname,'xb+');
$_errors = debug_backtrace();
if (!$fh)
  echo "<br />Fehler: $php_errormsg<br />";
  echo "<br />Fehler: $php_errormsg<br />";
  echo '<pre>';
  echo '</pre>';
  echo "<br />Datei $dateiname wurde angelegt<br />";
  $write_ok = fwrite($fh, 'Testtext');
  echo "<br />Schreibversuch in $dateiname: $php_errormsg<br />";

Expected result:
Fehler: failed to open stream: Permission denied

Actual result:
Notice: Undefined variable: php_errormsg in /home/thomas/public_html/test/artikel_locking/opentest.php on line 27 

== echo "<br />Schreibversuch in $dateiname: $php_errormsg<br />";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-11 13:30 UTC] tom at bitworks dot de
the open command was only:

$fh = fopen($dateiname,'xb');

without '+'
 [2004-08-28 20:28 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Ask support questions on how to use PHP elsewhere.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 13:01:31 2024 UTC