|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43749 function get_headers() fails on a particular URL
Submitted: 2008-01-04 12:02 UTC Modified: 2008-01-13 14:49 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: jeremy dot amiot at gmail dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.2.5 OS: Linux 2.4
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:
26 + 13 = ?
Subscribe to this entry?

 [2008-01-04 12:02 UTC] jeremy dot amiot at gmail dot com

get_headers() fails with this king of URL :

it returns me :
Warning:  get_headers( [function.get-headers]: failed to open stream: HTTP request failed!  in ********* on line 5.

But when you type this URL in your browser, it works well, it redirects you to a file. (header(location))

Reproduce code:
$url = '';

Expected result:
Fetches all the headers sent by the server in response to my HTTP request

Actual result:
Warning:  get_headers( [function.get-headers]: failed to open stream: HTTP request failed!  in ********* on line 5.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-13 14:49 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The returned Location header incorrectly contains spaces.
You can get the response header (before the failure) from the $http_response_header array.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 16:01:28 2024 UTC