#40661 [NEW]: cwd is reset when shutdown handler runs

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40661 [NEW]: cwd is reset when shutdown handler runs

    From: [email]derick@php.net[/email]
    Operating system: Linux
    PHP version: 4CVS-2007-02-27 (CVS)
    PHP Bug Type: *Directory/Filesystem functions
    Bug description: cwd is reset when shutdown handler runs

    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' );
    ?>



    --
    Edit bug report at [url]http://bugs.php.net/?id=40661&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40661&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40661&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40661&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40661&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40661&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40661&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40661&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40661&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40661&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40661&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40661&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40661&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40661&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40661&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40661&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40661&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40661&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40661&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40661&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40661&r=mysqlcfg[/url]
    derick@php.net Guest

  2. Similar Questions and Discussions

    1. Anyone runs tdiary 1.5.6?
      Hi! I'm trying to setup some simple Ruby blogger to enable me upload RSS feeds to the server. Having some problems with blogtari, I am trying...
    2. DataGrid's UpdateCommand event handler and CancelCommand handler problem
      I am having the same problem: the wrong event handler is being fired when column headings and page changes are clicked. I am using the datagrid...
    3. PhotoShop 7 no more runs
      I am working on Win-XP family edition. Yesterday the XP-system makes an "upgrate what's new" (I don't know what it fixed), and now I cannot run...
    4. Fast signal handler switching & thread-specific handler.
      jek_bask@ngs.ru (Evgeny Baskakov) writes: This is quite likely to crash on at least some pthread implementations (especially if sigaltstack was...
    5. CPU runs without L2 cache?
      i've a 43p-360 with two power3 200mhz processors. when i do a "lsdev -Ccprocessor" i get "proc0" and "proc2" as answer. when i do a "lsdev...
  3. #2

    Default #40661 [Opn->Bgs]: cwd is reset when shutdown handler runs

    ID: 40661
    Updated by: [email]tony2001@php.net[/email]
    Reported By: [email]derick@php.net[/email]
    -Status: Open
    +Status: Bogus
    Bug Type: *Directory/Filesystem functions
    Operating System: Linux
    PHP Version: 4CVS-2007-02-27 (CVS)
    New Comment:

    See [url]http://bugs.php.net/bug.php?id=36529[/url]


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-02-27 14:44:41] [email]derick@php.net[/email]

    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' );
    ?>




    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40661&edit=1[/url]
    tony2001@php.net Guest

  4. #3

    Default #40661 [Bgs->Opn]: cwd is reset when shutdown handler runs

    ID: 40661
    Updated by: [email]derick@php.net[/email]
    Reported By: [email]derick@php.net[/email]
    -Status: Bogus
    +Status: Open
    Bug Type: *Directory/Filesystem functions
    Operating System: Linux
    PHP Version: 4CVS-2007-02-27 (CVS)
    New Comment:

    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.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-02-27 14:54:34] [email]tony2001@php.net[/email]

    See [url]http://bugs.php.net/bug.php?id=36529[/url]

    ------------------------------------------------------------------------

    [2007-02-27 14:44:41] [email]derick@php.net[/email]

    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' );
    ?>




    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40661&edit=1[/url]
    derick@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139