Bug #14214: getcwd() and `pwd` return wrong directory
| From: | ASkwar at DigitalProjects dot com | Date: | Sat, 24 Nov 2001 23:47:19 +0000 |
| Subject: | Bug #14214: getcwd() and `pwd` return wrong directory | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-71558@lists.php.net to get a copy of this message | ||
From: ASkwar@DigitalProjects.com
Operating system: Linux
PHP version: 4.0.6
PHP Bug Type: Unknown/Other Function
Bug description: getcwd() and
pwd return wrong directory
I've written a small shell script in PHP, which should return the current
working directory:
-----
#!/usr/bin/php -q
<?php
echo pwd;
echo getcwd();
?>
-----
I've stored the script as /scripts/test.php and on the shell, I'm in
/scripts/Testing. When I run the script with »../test.php«, it returns
»/scripts« two times. I'd expect it to return »/scripts/Testing« two
times.
However, HTTP_ENV_VARS['PWD'] and HTTP_SERVER_VARS['PWD'] both contain the
correct (ie. /scripts/Testing) path.
--
Edit bug report at: http://bugs.php.net/?id=14214&edit=1