|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52351 Cannot send http status code without set new header raw
Submitted: 2010-07-15 20:02 UTC Modified: 2010-07-15 20:08 UTC
From: giorgio dot liscio at email dot it Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.3.2 OS: all? Windows xp x64
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 !
Your email address:
Solve the problem:
42 - 14 = ?
Subscribe to this entry?

 [2010-07-15 20:02 UTC] giorgio dot liscio at email dot it
hi, if i want only to send an http status code in php with the function header()
i must specify something on the first parameter otherwise the header is not sent

i want only to set 404 status code.. but none of those works

header("", TRUE, 404);
header(NULL, TRUE, 404);

but i need to use

header("X-Totally-Useless: true", TRUE, 404);

is this a bug?

thank you


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-15 20:08 UTC]
-Status: Open +Status: Bogus
 [2010-07-15 20:08 UTC]
As documented at, you would do it like this:

header("HTTP/1.0 404 Not Found");
 [2010-07-15 20:21 UTC] giorgio dot liscio at email dot it
hi rasmus it's an honor to talk with you :)

header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");

you don't think that this is actually hard to manage?

in plus, it is implemented in user space when it is already implemented by php

i don't like this

to make writing these things to the user increases the risk of bugs / incompatibilities with clients
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 06:01:26 2024 UTC