ID: 28890 User updated by: webmaster at rrze dot uni-erlangen dot de -Summary: readdir() doesn't work Reported By: webmaster at rrze dot uni-erlangen dot de Status: Open Bug Type: Directory function related Operating System: SunOS 5.9 PHP Version: 5.0.0RC3 New Comment:
Seperate build with gcc 3.4.0 eliminates the described readdir() problem. Apologies for declaring the problem as a php bug when it actually is a gcc issue. # gcc --version gcc (GCC) 3.4.0 Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Previous Comments: ------------------------------------------------------------------------ [2004-06-23 10:06:20] webmaster at rrze dot uni-erlangen dot de Description: ------------ uname -a: SunOS {HOSTNAME} 5.9 Generic_112233-12 sun4u sparc SUNW Ultra-Enterprise PHP5.0.0RC3, compiled as cgi-sapi (with cli) with gcc version 2.95.3 for 64bit. Calling the readdir() function returns a "Fatal error: Call to undefined function readdir()", both from the cgi- and cli-sapi. This is not influenced by execute rights of the php binary. Using -e (extended debugging info) and -n (don't use php.ini) doesn't provide any further information. This in turn makes the PEAR Installation fail as those scripts also use readdir(). opendir(), is_dir(), dir(), scandir(), getcwd(), chdir() all work. Reproduce code: --------------- CGI: ---- if ($handle = opendir("/any/path/here")) { while (false !== ($file = readdir($handle))) { echo "$file\n"; } } CLI: ---- php -e -n -r 'if ($handle = opendir("/any/path/here")) { while (false !== ($file = readdir($handle))) { echo "$file\n"; } };' Expected result: ---------------- list of files in the directory Actual result: -------------- Fatal error: Call to undefined function readdir() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28890&edit=1