Jump to content


This topic is now archived and is closed to further replies.


clearstatcache not working?

Recommended Posts

Okay I'm building a PHP driven document library where users can upload and download documents, create folders, sub-folders, etc.

I discovered that I needed to use clearstatcache to force PHP to actually look at the file system to determine if a file exists or if an item is a directory / folder. But when I remove files from the folder, PHP still thinks that the item is there when I use is_readable or is_dir or file_exists. I even went so far as to upgrade PHP from 5.1.4 to 5.1.6 and I restarted Apache too.

Does anyone have any insight on this?

In case you are wondering, my document library uses a database to store the list of document with some additional meta-data, so when a user visits a doc lib folder, PHP grabs records from the database to see which files are in the directory, then checks the file system to make sure that the files are actually there.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.