#18908 [NEW]: Not getting Current Working Directory
| From: | duke at mastre dot com | Date: | Wed, 14 Aug 2002 22:57:32 +0000 |
| Subject: | #18908 [NEW]: Not getting Current Working Directory | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-16852@lists.php.net to get a copy of this message | ||
From: duke@mastre.com
Operating system: Linux 2.4.19
PHP version: 4CVS-2002-08-14
PHP Bug Type: *Directory/Filesystem functions
Bug description: Not getting Current Working Directory
Apache: 2.0.40
PHP: php4-STABLE-200208140900
not much else
Why am I running a snapshot? Because cookies are [still] broken in 4.2.2
when running with Apache2, and I need to run Apache2.
Problem: any/most filesystem functions do not know what the current
directory is. This is a big problem, as it's broken 85% of my scripts
(also totally breaks Smarty).
Reproduce:
$ cd /var/www/html/test
$ cat test.php
<?php
echo('current working directory: ' . getcwd() . '<br />');
echo('w/o getcwd(): ' . (file_exists('test.php') ? 'true' :
'false') .
'<br />');
echo('with getcwd() . /: ' . (file_exists(getcwd() . '/' .
'test.php') ?
'true' : 'false'));
?>
http://somehost/test/test.php outputs this:
current working directory: /var/www/html/test
w/o getcwd(): false
with getcwd() . /: true
On 4.2.2 (rel) / 1.3.26 it correctly outputs:
current working directory: /var/www/html/test
w/o getcwd(): true
with getcwd() . /: true
Fix: yes, please ;)
--
Edit bug report at http://bugs.php.net/?id=18908&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18908&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18908&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18908&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18908&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18908&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18908&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18908&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18908&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18908&r=globals