#21044 [Bgs->Opn]: getcwd() returns empty string (not always)

From: Date: Wed, 18 Dec 2002 15:48:27 +0000
Subject: #21044 [Bgs->Opn]: getcwd() returns empty string (not always)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27973@lists.php.net to get a copy of this message
ID: 21044 User updated by: miki@ceti.pl Reported By: miki@ceti.pl -Status: Bogus +Status: Open Bug Type: Directory function related Operating System: Linux, 2.2.22 PHP Version: 4.3.0RC3 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#27973) next »