views:

44

answers:

2

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?

A: 

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?

Thomas Winsnes
A: 

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

Josh
Yeah, mkdir specified 0755, and umask is set to (I think) 002.
Warren Benedetto