php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50007 PHP working as FastCGI can't send Last-Modified header
Submitted: 2009-10-26 23:17 UTC Modified: 2009-11-04 01:00 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (66.7%)
From: vlad at todosv dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.2.10 OS: Any, but tested in Ubuntu
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:
MUST BE VALID
Solve the problem:
28 + 29 = ?
Subscribe to this entry?

 
 [2009-10-26 23:17 UTC] vlad at todosv dot com
Description:
------------
Keeping it simple:

If you have PHP as a Apache's Mod you can send Last-Modified without problems.

If you have PHP as CGI/FastCGI Last-Modified header is not sent as intented, and which is worse, it's sent as: Last-Modified	Thu, 01 Jan 1970 00:00:00 GMT.

The problem with this is that I can't do custom file caching by sending 304 header.

Reproduce code:
---------------
<?php
        header('Last-Modified: mon, 26 oct 2009 18:26:27 GMT');
        header('mtime: mon, 26 oct 2009 18:26:27 GMT');
	print implode('<br />',headers_list());
?>

It will output the same header_list() regardless it's *CGI or as apache mod.

It prints the following:
X-Powered-By: PHP/5.2.10-2ubuntu6
Last-Modified:lun, 26 oct 2009 18:26:27 GMT
mtime: lun, 26 oct 2009 18:26:27 GMT

But received headers are not the same.

Expected result:
----------------
As an Apache Mod:
X-Powered-By	PHP/5.2.10-2ubuntu6
mtime	mon, 26 oct 2009 18:26:27 GMT
Last-Modified	mon, 26 oct 2009 18:26:27 GMT

Actual result:
--------------
As *GCI:
X-Powered-By	PHP/5.2.10-2ubuntu6
mtime	mon, 26 oct 2009 18:26:27 GMT
Last-Modified	Thu, 01 Jan 1970 00:00:00 GMT

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-27 22:20 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Works, fine, for, me.
 [2009-11-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-11-19 12:32 UTC] phpmyforum at gmail dot com
Still experiencing this bug in PHP 5.3.0
 [2011-08-29 12:46 UTC] phbug at netspider dot kiev dot ua
Still experiencing this bug in PHP 5.3.8 and 5.2.17.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:28 2024 UTC