|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15994 PHP should support Status-headerline
Submitted: 2002-03-11 07:24 UTC Modified: 2002-09-25 02:42 UTC
From: habazi at yahoo dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.0.5 OS:
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:
45 + 36 = ?
Subscribe to this entry?

 [2002-03-11 07:24 UTC] habazi at yahoo dot com
Apache returns HTTP-status code according to Status:-header line returned by a cgi-script. PHP should do that too because it's a good feature to support that behavior to allow script-writers return custom status-codes.

Status is not a real HTTP header but a HTTP-server could return e.g. "HTTP/1.0 404" from a cgi-script. But it doesn't work that way for PHP when running as a module inside Apache. It could.



if (file_exists($file))

  echo mtime($file);


  header("Status: 404 Not Found");


In Apache it's done this way

But this doesn't get done for PHP when running as a module.

(Apache 1.3.9 util-script.c





      * If the script returned a specific status, that's what

         * we'll use - otherwise we assume 200 OK.


        else if (!strcasecmp(w, "Status")) {

            r->status = cgi_status = atoi(l);

            r->status_line = ap_pstrdup(r->pool, l);




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 08:11 UTC]
You can do header("HTTP/1.1 404"); and PHP will create a nice header for it.
 [2002-09-25 02:42 UTC]
This was not bogus and has been fixed in 4.3.x. Thanks for your report.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Mar 04 12:01:24 2021 UTC