#29451 [Opn->WFx]: getlastmod() returns access time - solution
| From: | iliaa@php.net | Date: | Mon, 23 Aug 2004 17:16:37 +0000 |
| Subject: | #29451 [Opn->WFx]: getlastmod() returns access time - solution | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-65105@lists.php.net to get a copy of this message | ||
ID: 29451
Updated by: iliaa@php.net
Reported By: robert at rw-it dot net
-Status: Open
+Status: Wont fix
Bug Type: Apache related
Operating System: Linux
PHP Version: Irrelevant
New Comment:
The problem is that normal (module) PHP build only involves
Apache headers which do not appear to provide this
information. Consequently PHP cannot perform the check you
have mentioned.
Previous Comments:
------------------------------------------------------------------------
[2004-07-30 01:36:07] robert at rw-it dot net
Description:
------------
With some combinations of mod_php and Apache, getlastmod() returns the
access time instead of the modification time.
All bug reports that deal with this seem to have been closed with
"Works in CVS" or "Apache problem", both of which are not true.
The Problem occurs if Apache was built with large file size (64-bit)
support and mod_php wasn't, so they are essentially using different
stat(2) structures. If 64-bit file offsets are used, the st_blocks
member of struct stat grows to 64 bits and pushes the time members 32
bits "upwards". If you access this structure as a 32-bit stat structure
from mod_php, st_atime contains garbage, st_mtime the access time and
st_ctime the modification time of the 64-bit structure (voila!).
The easy solution is to #define _FILE_OFFSET_BITS to 64, if Apache does
(did) this.
The hard part is that I don't know how to figure out if Apache uses 32
or 64 bits after it is installed.
Secondly, PHP itself would have to use 64-bit stat structures, and I
don't know if this might lead to more problems.
So maybe it's better to transform the stat structure in mod_php?
Any ideas?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29451&edit=1