php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24213 filemtime(string) and getlastmod() works very strange...
Submitted: 2003-06-16 18:32 UTC Modified: 2003-07-07 19:38 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 3 (66.7%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mf22cs at student dot hik dot se Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.2 OS: WinXP Pro and Linux/Slack 2.4.18
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mf22cs at student dot hik dot se
New email:
PHP Version: OS:

 

 [2003-06-16 18:32 UTC] mf22cs at student dot hik dot se
Description:
------------
getlastmod() gives the correct result on my localhost (which is at WinXP running IIS 5.1 with PHP4.3.2). But on the Linux webserver (running Apache 1.3.27 and PHP4.3.1) it gives a totally wrond result (that seems to be the last accesstime).

Then I tried the filemtime(string) instead, but then my localhost got all crazy. It showed the birthdate of UNIX instead.


Reproduce code:
---------------
GLM: <?php
	echo date("d-m-Y H:i:s",getlastmod());
?>
<br/>FMT: <?php
	echo date("d-m-Y H:i:s",filemtime(trim($_SERVER["SCRIPT_FILENAME"])));
?>

Expected result:
----------------
GLM: 17-06-2003 01:20:55
FMT: 17-06-2003 01:20:55

at both systems (if that is the correct date/time of modification).

Actual result:
--------------
At the server this gives the following result: 
GLM: 17-06-2003 01:11:35 
FMT:17-06-2003 01:18:23 

And at local host: 
GLM: 17-06-2003 01:18:21 
FMT:01-01-1970 01:00:00 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-18 14:36 UTC] iliaa@php.net
Works just fine with Linux here using latest CVS.

Are you using ZTS (threaded php) on linux?
 [2003-06-26 18:22 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-06-27 02:55 UTC] mf22cs at student dot hik dot se
I still experience the problem, but since there is no solution provided I did not know I had to responde to the answare at the 18th of June.

ZTS? don?t know...

/Marcus
 [2003-07-07 19:38 UTC] sniper@php.net
Works fine here too. Perhaps your glibc is some broken version or you need to call 'clearstatcache()' between those getlastmod()/filemtime() calls.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 15:01:33 2024 UTC