#21044 [Opn->Csd]: getcwd() returns empty string (not always)
| From: | moriyoshi@php.net | Date: | Sat, 18 Jan 2003 16:00:44 +0000 |
| Subject: | #21044 [Opn->Csd]: getcwd() returns empty string (not always) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30472@lists.php.net to get a copy of this message | ||
ID: 21044
Updated by: moriyoshi@php.net
Reported By: miki@ceti.pl
-Status: Open
+Status: Closed
Bug Type: Directory function related
Operating System: Linux, 2.2.22
PHP Version: 4.3.0RC3
Previous Comments:
------------------------------------------------------------------------
[2002-12-18 09:48:26] miki@ceti.pl
I've got the solution! After hacking php sources for a few hours (ok,
minutes...) I've found the solution:
I had to add '#define VIRTUAL_DIR 0' line just before '#ifdef
VIRTUAL_DIR' condition in TSRM/tsrm_virtual_cwd.h file.
To my surprise defined values (0 wether 1) has no effect. I just had to
add that define. Now everything works.
Well, maybe it's my gcc fault. I'm using quite an old one: 2.7.2.3
Thanks for your time.
------------------------------------------------------------------------
[2002-12-16 10:17:03] iliaa@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
I've tries the latest 4.3.0 stable CVS and cannot replicate the bug.
getcwd() on non-zts installs uses the native getcwd() provided by your
libc, so the virtual host or simular things will have no affect on it.
------------------------------------------------------------------------
[2002-12-16 08:56:52] miki@ceti.pl
According to phpinfo():
./configure --with-apxs=/usr/local/apache/bin/apxs --without-pear
--with-zlib --with-dom --without-xml --with-expat-dir=/usr/local
--with-iconv=/usr/local --with-curl --with-pgsql=/usr/local/pgsql
--enable-ftp
Full phpinfo() output can be found at:
http://www.ma.krakow.pl/~miki/test.php
Now that site is running 4.3.0-pre1, but it behaves the same like
4.3.0rc3 I tested it on (with the same configure parameters).
------------------------------------------------------------------------
[2002-12-16 08:49:30] iliaa@php.net
Could you please show the parameters you've passed to PHP's configure
script, they can be found inside config.nice.
------------------------------------------------------------------------
[2002-12-16 08:04:36] miki@ceti.pl
getcwd() works only within pages in 'main' document root.
Pages under user directories (/~user/) and pages located in every
virtual host directory doesn't get proper getcwd().
It results in include() and reqiure() using relative paths not working.
Bug came out when I was trying to install fresh copy of postnuke.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21044&edit=1