This question is for my understanding, I can live with they way things are, but, if I could change it that would be even better.
Here's the issue: when file_exists() is used in PHP running under Apache, the function will not return TRUE as it should unless the file has the group execute bit set. This doesn't make sense to me because I thought the execute bit was only need for files that were to be executed. A file being examined by an executing piece of code should read just as long as the read bit is set as far as I know.
A little more information:
The file is a .png, e.g.: image.png.
The distro is OpenSUSE 11.4
PHP is version 5.3.8
Apache version is 2.2.17
The permissions and owner of the file being read are: 754 reg:web-dev
Apache is running as user wwwrun:www. It has the group web-dev added to it as well.
If the file's permissions are 744 PHP's file_exists() will always return FALSE
If the file's permissions are 754 PHP's file_exists() will return TRUE to show that file exists (as it should)
The annoying part about this is that there are many PHP files that are actually being executed but they don't need more than 644 to execute so why would file_exists() suddenly need the group execute bit as well (654 or 754).
A second part to this question is, is this something that could be changed somehow? I.e., make it so only the read bit is required. Then more reasonable permissions for an image could used like 644 or even 640.