|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32605 ini_set('last_modified', 1) doesn't work
Submitted: 2005-04-06 12:49 UTC Modified: 2005-04-06 17:47 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: s dot tabacchiera at gruppocsf dot com Assigned:
Status: Wont fix Package: Apache related
PHP Version: 4.3.11 OS: RedHat Linux 8.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
38 + 50 = ?
Subscribe to this entry?

 [2005-04-06 12:49 UTC] s dot tabacchiera at gruppocsf dot com
Hi, as stated in the summary the directive ini_set('last_modified', 1) in my scripts doesn't work.

In facts, I don't see any Last-Modified header in the Apache response.

Any clue?

Reproduce code:
ini_set("last_modified", 1);
echo "Hello world!\n";

# wget -S http://localhost/foo.php
Resolving localhost...
Connecting to localhost[]:80... connected.
HTTP request sent, waiting for response...
 1 HTTP/1.1 200 OK
 2 Date: Wed, 06 Apr 2005 10:28:34 GMT
 3 Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.6b PHP/4.3.11 mod_auth_pgsql/0.9.12
 4 X-Powered-By: PHP/4.3.11
 5 Set-Cookie: ZDEDebuggerPresent=php,phtml,php3
 6 Connection: close
 7 Content-Type: text/html

Expected result:
. Last-Modified: ...blablabla...

Actual result:
no 'Last-Modified' header


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-06 13:47 UTC]
Does it work if you change the option in php.ini?

 [2005-04-06 14:25 UTC] s dot tabacchiera at gruppocsf dot com
Yes, it works!
Last-Modified: Mon, 22 May 2000 21:45:00 GMT
 [2005-04-06 17:47 UTC]
last_modified is a SAPI-level ini setting which is checked and acted upon from the individual SAPI modules prior to PHP getting control.  I don't see this changing, especially since the workaround is trivial.

  $mod = gmdate("D, d M Y H:i:s ",getlastmod())."GMT";
  header("Last-Modified: $mod");
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jan 17 19:03:34 2022 UTC