php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5566 invalid Directory resource from opendir, but only sometimes?
Submitted: 2000-07-13 18:47 UTC Modified: 2000-07-13 18:49 UTC
From: johnf at aztech-cs dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1 OS: linux redhat 2.2.16
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: johnf at aztech-cs dot com
New email:
PHP Version: OS:

 

 [2000-07-13 18:47 UTC] johnf at aztech-cs dot com
DESCRIPTION
Roughly half the time while reading from the directory handle, an invalid Directory resource error occurs.  (When page is repeatedly reloaded)

SCRIPT
# Load Directory Into Array

$dir = "../images/";

$handle = opendir($dir);
while ($file = readdir($handle)) {

  if ($file != "." && $file != "..") {

    $images[count($images)] = $file;

}
# Clean up and sort
closedir($handle);

CONFIGURE COMMANDS
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr' '--with-config-file-path=/etc/httpd/conf' '--with-pgsql' '--enable-debugger' '--with-gdbm' '--with-ndbm'

ALL PHP.INI SETTINGS ARE DEFAULT

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-13 18:49 UTC] sterling at cvs dot php dot net
fixed in 4.0.1pl2.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 21:00:01 2026 UTC