Re: Why getcwd() returs different results?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's an example from the PHP website:

This demonstrates the behaviour:

<?php
function echocwd() { echo 'cwd: ', getcwd(), "\n"; }
echocwd();
register_shutdown_function('echocwd');
?>

Outputs:

cwd: /path/to/my/site/docroot/test
cwd: / 


http://php.net/manual/en/function.register-shutdown-function.php

It's a known problem but I can't see why this can't be fixed




________________________________
From: Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx>
To: Raymond Irving <xwisdom@xxxxxxxxx>
Cc: PHP-General List <php-general@xxxxxxxxxxxxx>
Sent: Thu, November 5, 2009 6:09:19 AM
Subject: Re:  Why getcwd() returs different results?

On Wed, 2009-11-04 at 17:36 -0800, Raymond Irving wrote: 
Hello,
>
>The getcwd() method returns a different path when called from inside a shutdown function under Apache. On windows IIS it works just fine.
>
>Can't this be fixed so that the path returned is consistent across servers? 
>
>It would appear that PHP should set the CWD path before calling the shut down functions
>
>__
>Raymond Irving
>
What shutdown functions are you meaning? Do you have an example which shows the problem?


Thanks,
Ash
http://www.ashleysheridan.co.uk

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux