#18908 [Opn->Fbk]: Not getting Current Working Directory

From: Date: Wed, 14 Aug 2002 23:17:03 +0000
Subject: #18908 [Opn->Fbk]: Not getting Current Working Directory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16855@lists.php.net to get a copy of this message
ID: 18908 Updated by: kalowsky@php.net Reported By: duke@mastre.com -Status: Open +Status: Feedback Bug Type: *Directory/Filesystem functions Operating System: Linux 2.4.19 PHP Version: 4CVS-2002-08-14 New Comment: Running on FreeBSD, and MacOSX I cannot reproduce this problem.. I get the following output: current working directory: /Users/dank/Development/php4-cvs<br /> w/o getcwd(): true<br /> with getcwd() . /: true This is from CVS HEAD. I'm also not using Apache2 though. Any chance you can try this with Apache 1.3.x? Previous Comments: ------------------------------------------------------------------------ [2002-08-14 18:57:32] duke@mastre.com 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 this bug report at http://bugs.php.net/?id=18908&edit=1

« previous php.bugs (#16855) next »