php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35433 phpinfo() function does no send a Content-Type header
Submitted: 2005-11-27 23:20 UTC Modified: 2005-11-27 23:45 UTC
From: cyberdog3k at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.1.0 OS: Windows Server 2003
Private report: No CVE-ID: None
 [2005-11-27 23:20 UTC] cyberdog3k at gmail dot com
Description:
------------
The phpinfo() function does not return a Content-Type header.  I found in ext/standard/info.c that the <meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" /> line is commented out, but there does not seem to be an explanation in the comments for why this is the case.  I've verified that no Content-Type header is ever inserted on its way to the client.  This poses a problem when validating the results, and would seem to be poor practice even if it's not entirely necessary to have the tag in there.

Reproduce code:
---------------
<?php 
  phpinfo();
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-27 23:26 UTC] tony2001@php.net
Why did you decide it doesn't send it?
Did you check it with telnet or something else?
From what I can see, the header is there and it's fine:

Content-Type: text/html

 [2005-11-27 23:42 UTC] cyberdog3k at gmail dot com
This bug is apparently invalid.  I was being thrown by the fact that default_charset was commented out by default in php.ini, which was causing php to not send any charset with the header.  This was causing validation to fail.  This combined with the commented out portion of source led me to the conclusion that the header was missing.  My final question would be is it good practice to have PHP sending no charset by default?  Maybe this makes it more universal or something in forcing everyone to set it manually?  I just feel like I should have been prompted for charset during setup or something, rather than just leaving it out.  Maybe worthy of a feature request?
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC