Take the 2-minute tour ×

Just had something really weird happen, and I'm not sure why. Our site crashed because PHP couldn't write a cache file to a directory which is created automatically by the script. When I investigated, I saw that the directory had NO permissions: no read or write for owner, group, or public.

This script creates directories hundreds of times a day, with no problems. Indeed, when I sudo'd and removed the dir, it was re-created with the correct permissions instantly.

I've never seen a directory with absolutely no permissions, so I'm just curious how that could have happened. Any thoughts?

share|improve this question

2 Answers 2

Sounds like the directory wasn't unlocked/closed before the php script stopped running. Got any execution paths that would lead to this in your script?

share|improve this answer

Does the call to mkdir set the $mode parameter? Do you use the umask function anywhere in the code?

share|improve this answer
Yeah, mkdir specified 0755, and umask is set to (I think) 002. –  Warren Benedetto May 20 '10 at 12:32

Your Answer


