#35227 [Fbk->Opn]: getcwd does not work

From: Date: Tue, 15 Nov 2005 13:11:18 +0000
Subject: #35227 [Fbk->Opn]: getcwd does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88208@lists.php.net to get a copy of this message
ID: 35227 User updated by: rd at mesos dot de Reported By: rd at mesos dot de -Status: Feedback +Status: Open Bug Type: Directory function related Operating System: Linux Fedora Core release 2 PHP Version: 4.4.1 New Comment: that's why I am reporting that bug, it is working on several servers, but not on this one: [root@server php-4.4.1]# ./sapi/cli/php -r 'echo getcwd();' [root@server php-4.4.1]# It must be something special on this server, but I don't know where to start to search. gcc version 3.3.3 The same problem exists with PHP 4.4.0. Previous Comments: ------------------------------------------------------------------------ [2005-11-15 14:08:08] tony2001@php.net What's the values of HAVE_GETCWD and HAVE_GETWD in main/php_config.h ? ------------------------------------------------------------------------ [2005-11-15 14:06:11] sniper@php.net You're doing something wrong, this works just fine for me: # php -r 'echo getcwd();' /usr/src/php_5_1 ------------------------------------------------------------------------ [2005-11-15 13:58:09] rd at mesos dot de [root@server php-4.4.1]# ./sapi/cli/php test2.php bool(false) bool(false) olddir: [root@server php-4.4.1]# cat test2.php<? $olddir = var_dump(getcwd()); var_dump(getcwd()); echo "olddir: $olddir\n"; ?> [root@server php-4.4.1]# ------------------------------------------------------------------------ [2005-11-15 13:47:45] tony2001@php.net Use var_dump(getcwd()); ------------------------------------------------------------------------ [2005-11-15 13:38:50] rd at mesos dot de Description: ------------ getcwd() doesn't return anything. The same script is working on other servers. It has been tested as root. It is also not working via Apache. All directorys below the test script have chmod 755. Reproduce code: --------------- <? $olddir = getcwd(); echo "olddir: $olddir\n"; ?> Expected result: ---------------- olddir: /usr/src/php-4.4.1 Actual result: -------------- olddir: ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35227&edit=1

« previous php.bugs (#88208) next »