This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » eZ Publish 5 Platform » header expires: 0 causing critical error

header expires: 0 causing critical error

header expires: 0 causing critical error

Monday 28 October 2013 4:31:27 pm - 2 replies


I'm running a 5.1 installation with the following legacycode for an export to excel:

header("Content-Type: application/"blunk.gif Emoticon;
header("Content-Disposition: attachment; filename=event.xls"blunk.gif Emoticon;
header("Pragma: no-cache"blunk.gif Emoticon;
header("Expires: 0"blunk.gif Emoticon;

This code was working in 4.7 but in 5.1 it generates the following error in ezpublish/logs/prod.log:

request.CRITICAL: Uncaught PHP Exception Exception: "DateTime::__construct(): Failed to parse time string (0) at position 0 (0): Unexpected character" at /storage/kunder/ line 123 [] []

and causes the page to go blank (of course).

If i comment out header("Expires: 0"blunk.gif Emoticon; it works but the file is downloaded as "event.xls, attachment" insted of "event.xls".

Anyone eager to point me in the right direction? How should i define my header?

- Harald

Monday 28 October 2013 5:17:38 pm

Hi Harald

try setting the Expiry Header to a valid date in the past (see

Hope this helps.

Regards, Donat

Tuesday 29 October 2013 10:10:53 am

Thanks, Donat!


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from