php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34371 Incorrect working directory in some callback functions.
Submitted: 2005-09-05 06:06 UTC Modified: 2005-09-05 08:08 UTC
From: hightman2 at yahoo dot com dot cn Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.4.0 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hightman2 at yahoo dot com dot cn
New email:
PHP Version: OS:

 

 [2005-09-05 06:06 UTC] hightman2 at yahoo dot com dot cn
Description:
------------
When the callback functions was called by register_shutdown_function(), ob_start(); the current working directory will be changed to the root directory (such as '/').

Notice: bug found when running the script under web browser.

Reproduce code:
---------------
<?php
function test_cb() {
  echo getcwd() . "<br>\n";
}

register_shutdown_function("test_cb");
test_cb();
?>

Expected result:
----------------
/home/hightman/public_html/my_php4<br>
/home/hightman/public_html/my_php4<br>

Actual result:
--------------
/home/hightman/public_html/my_php4<br>
/<br>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-05 08:08 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

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