php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40661 cwd is reset when shutdown handler runs
Submitted: 2007-02-27 14:44 UTC Modified: 2011-04-08 21:22 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: derick@php.net Assigned:
Status: Open Package: Apache related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-02-27 14:44 UTC] derick@php.net
Description:
------------
When this script is run with the Apache1 sapi the second CWD is reset to /.

This is an issue for both php 4.4.4 and php 5.2.1rc3.

Reproduce code:
---------------
<?php
echo "CWD = ", getcwd(), "\n";

function handler()
{
    echo "CWD = ", getcwd(), "\n";
    echo dirname( __FILE__ ), "\n";
}

register_shutdown_function( 'handler' );
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-27 15:00 UTC] derick@php.net
I disagree, there is no reason why PHP can't reset the CWD to the correct directory when a shutdown handler is run. That is what I would expect to happen.
 [2007-07-11 12:35 UTC] jani@php.net
Making sure this doesn't slip through the cracks..also found in PHP 5.2
 [2011-04-08 21:22 UTC] jani@php.net
-Package: Feature/Change Request +Package: Apache related
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Dec 05 02:01:23 2020 UTC