Re: Why getcwd() returs different results?
| From: | Raymond Irving | Date: | Fri, 06 Nov 2009 01:53:04 +0000 |
| Subject: | Re: Why getcwd() returs different results? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299672@lists.php.net to get a copy of this message | ||
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@ashleysheridan.co.uk>
To: Raymond Irving <xwisdom@yahoo.com>
Cc: PHP-General List <php-general@lists.php.net>
Sent: Thu, November 5, 2009 6:09:19 AM
Subject: Re: [PHP] 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