Bug #16630 Updated: getlastmod() returns file access time, not modification time
| From: | derick@php.net | Date: | Tue, 18 Jun 2002 08:51:26 +0000 |
| Subject: | Bug #16630 Updated: getlastmod() returns file access time, not modification time | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11064@lists.php.net to get a copy of this message | ||
ID: 16630
Updated by: derick@php.net
Reported By: johan@ekenberg.se
Status: Open
-Bug Type: *Directory/Filesystem functions
+Bug Type: Apache related
Operating System: Linux, glibc 2.2.3
PHP Version: 4.1.2, 4.3.0-dev
New Comment:
It's an apache thing... as it works fine in CGI mode.
Previous Comments:
------------------------------------------------------------------------
[2002-06-11 18:34:56] jerry.zhao@vanderbilt.edu
Different platform, same problem.
Apache 1.3.24
PHP 4.1.2
Solaris 7 / Sun Sparc server
gcc 2.95.2
------------------------------------------------------------------------
[2002-05-09 08:27:52] johan@ekenberg.se
I've built (statically) the latest snapshot (php4-200110220000 from
snaps.php.net) with apache-1.3.24, and the results are exactly the
same. Example here:
http://www2.aname.net/~johan/getlastmod/getlastmod.php
filemtime() works correctly as you suggest.
------------------------------------------------------------------------
[2002-05-04 22:11:41] matslin@orakel.ntnu.no
I've been browsing around trying to look for a cause of this
behaviour... Currently its working like it should, both under Apache
1.3.24 / (current CVS head) (as module), under Apache 1.3.23 / (CVS
from 9. March) (compiled static). It does however seem broken in Apache
2.0.35 (probably since apache2filter doesnt provide path_translated in
the request_rec (or something, i'm not an apache2-expert or very used
to the php-source)).
Could you try compiling the current CVS and see if you're still
experiencing this problem? I did get the same results as you got
earlier (with 4.2.0 under Apache 2.0.35 (yes, i noticed you're running
1.3.23)), but after makeing and make installing the fresh version from
cvs, i now get just a 'false' instead.
I have the following test pages:
Apache 1.3.23/PHP CVS from march
http://home.e-mats.org/test-getlastmod.php
Apache 1.3.24/Current CVS HEAD
http://home.e-mats.org:809/test-getlastmod.php
Apache 2.0.35/Current CVS HEAD
http://home.e-mats.org:808/test-getlastmod.php
The source (which pretty much should be explained from the page:
http://home.e-mats.org/test-getlastmod.phps
One more thing, if you could just try to use filemtime() with the same
file, you would probably get the right results.
------------------------------------------------------------------------
[2002-04-16 05:39:36] johan@ekenberg.se
This is similar to http://bugs.php.net/bug.php?id=14837 which was
discarded with a "works in CVS". I'm not so sure it's solved that
easily.
Example page here:
http://www.ekenberg.se/php_getlastmod/getlastmod.php
The example shows the output from getlastmod() compared to "ls -l" and
"ls -lu". There's also a link to phpinfo().
The bug only appears when using PHP as an Apache module. When running
from the commandline the file modification time is shown correctly.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16630&edit=1