PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Header » Bug #2063

error msg gmdate()

Details

Submitted2004-08-05 11:02 UTC
Fromcpuidle at gmx dot de
Assignedmike
StatusClosed
PackageHTTP_Header
PHP Version5.0.0
OSWinXP
Roadmaps(Not assigned)

Comments

[2004-08-05 11:02 UTC] cpuidle at gmx dot de

Description:
------------
Error message:

Warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\Program Files\php\PEAR\HTTP.php on line 57

Reproduce code:
---------------
<?php

require_once 'HTTP/Header/Cache.php';

// only cache a few seconds for frequently
// changing pages like a forum;
// Header_Cache will exit automatically with
// "HTTP 304 Not Modified" if the page is
// requested twice within 3 seconds

$cache = &new HTTP_Header_Cache(3, 'seconds');
$cache->sendHeaders();

// ... load from file/db cache
// ... or rebuild page

?>

Reload page with IE, 2nd time the error appears

Expected result:
----------------
no error

Actual result:
--------------
Error message:

Warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\Program Files\php\PEAR\HTTP.php on line 57

[2004-08-05 12:56 UTC] cpuidle at gmx dot de

Not sure what else you need. Code is sample code supposed create caching headers to lessen HTTP server load. Server is Apache2 on localhost, Browser is IE6. After loading the page, then clicking 'reload' the issue appears. The problem only appears with direct connection, when going why proxy it doesn't happen.

[2004-08-05 13:00 UTC] cpuidle at gmx dot de

The error only happens the second time. Headers sent by IE first time are:

GET /caching.php HTTP/1.1
Accept: */*
Accept-Language: en-us,de;q=0.5
Accept-Encoding: gzip, deflate
If-Modified-Since: Thu, 05 Aug 2004 12:57:27 GMT; length=0
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Host: supportweb.dyndns.org
Connection: Keep-Alive
Cookie: ZDEDebuggerPresent=php,phtml,php3

Answer:

HTTP/1.0 200 OK
Date: Thu, 05 Aug 2004 12:57:27 GMT
Server: Apache/2.0.50 (Win32) mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/5.0.0
X-Powered-By: PHP/5.0.0
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3
pragma: cache, no-cache
cache-control: public, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
last-modified: Thursday, 05-Aug-04 12:57:27 GMT
Content-Encoding: gzip
Content-Length: 20
Connection: close
Content-Type: text/html; charset=ISO-8859-1

Headers send by IE second time are:

GET /caching.php HTTP/1.1
Accept: */*
Accept-Language: en-us,de;q=0.5
Accept-Encoding: gzip, deflate
If-Modified-Since: Thu, 05 Aug 2004 12:57:27 GMT; length=0
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Host: supportweb.dyndns.org
Connection: Keep-Alive
Cookie: ZDEDebuggerPresent=php,phtml,php3

Answer:

HTTP/1.0 200 OK
Date: Thu, 05 Aug 2004 12:57:29 GMT
Server: Apache/2.0.50 (Win32) mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/5.0.0
X-Powered-By: PHP/5.0.0
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3
Content-Encoding: gzip
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 197
Connection: close
Content-Type: text/html; charset=ISO-8859-1