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

From: Date: Thu, 15 Aug 2002 15:02:54 +0000
Subject: #18908 [Fbk->Csd]: Not getting Current Working Directory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16906@lists.php.net to get a copy of this message
ID: 18908 User updated by: duke@mastre.com Reported By: duke@mastre.com -Status: Feedback +Status: Closed Bug Type: Apache2 related Operating System: Linux 2.4.19 PHP Version: 4CVS-2002-08-14 New Comment: . Previous Comments: ------------------------------------------------------------------------ [2002-08-15 11:00:29] duke@mastre.com I tried with the unstable snapshot and it works. ------------------------------------------------------------------------ [2002-08-14 22:28:14] kalowsky@php.net moving this to apache2 related. Please realize that PHP and Apache2 is a VERY experiemental thing, and not very likely to be fixed quickly. And yes we developers are reading this... ------------------------------------------------------------------------ [2002-08-14 22:19:27] duke@mastre.com I'm sure it will work, my problem is on Apache2. If I didn't need to run with Apache2 I wouldn't be using the snapshot in the first place. I would be interested to know if you can duplicate it on FreeBSD/OS X using Apache2. Any developer out there reading this? ------------------------------------------------------------------------ [2002-08-14 19:17:03] kalowsky@php.net 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? ------------------------------------------------------------------------ [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 (#16906) next »