php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11632 Bad Request on most Sites
Submitted: 2001-06-23 15:22 UTC Modified: 2001-07-14 11:04 UTC
From: cheapsalsa at yahoo dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.0.6 OS: Red Hat Linux 7.0 Standard
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cheapsalsa at yahoo dot com
New email:
PHP Version: OS:

 

 [2001-06-23 15:22 UTC] cheapsalsa at yahoo dot com
I have created a webpage to get the HTTP headers of a page.  This worked fine with 4.0.5 (using the $http_request_header variable.)  But, in 4.0.6, almost all websites give me a 400 Bad Request Error when using this script.  To get the webpages I use

$pagefile=file("http://$url");

where $url is the url (without the http://)  I want to use.  The only site I have found that does not give me a 400 error is www.yahoo.com.  As I said, this script worked fine with 4.0.5 and I have not changed anything since using 4.0.6.  I just installed PHP 4.0.6 today (June 23.)  I compiled it with Apache 1.3.20 using all the same configure stuff, etc...  Compiling process went normal.  I can usually debug things like this, but I cannot figure out what would have caused this one.  I am guessing PHP is sending corrupted requests, but I really don't know.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-23 15:28 UTC] cheapsalsa at yahoo dot com
Whoa!  I figured something out.  If I request http://finance.yahoo.com (without the last slash) I get 400 errors, but with the slash (http://finance.yahoo.com/) it works fine.  As does any other page on the site (http://finance.yahoo.com/index.html)  I think PHP is sending "GET  HTTP/1.0" because I used the script on MY site and in my error log file, it says "Invalid URI 'GET  HTTP/1.0'"
 [2001-06-23 16:49 UTC] sniper@php.net
reclassified.

 [2001-06-25 09:34 UTC] cheapsalsa at yahoo dot com
ok...do you see what I mean?
 [2001-06-27 13:43 UTC] sniper@php.net
No, this works for me just fine.
Do you get any error messages? In apache logs?

--Jani

 [2001-06-28 10:55 UTC] cheapsalsa at yahoo dot com
Yes, (my intranet site address, which I use the script on,
is http://intranet)  If I requested "http://intranet" I
would get a 400 error and in the Apache log, it would say
"Invalid URI 'GET  HTTP/1.0'" instead of a valid request
"GET / HTTP/1.0"  BUT, if I request "http://intranet/" (WITH
THE END SLASH), everything works fine!
 [2001-06-29 19:21 UTC] cynic@php.net
Maybe you should read related documentation (the Apache manual would do if the HTTP RFC is too hard to congest for you). 

> If I requested "http://intranet" I
> would get a 400 error and in the Apache log, it would say
> "Invalid URI 'GET  HTTP/1.0'" instead of a valid request
> "GET / HTTP/1.0"I don't see

And where in "http://intranet" do you request "/"? Nowhere.

This is bogus.
 [2001-06-29 19:24 UTC] cynic@php.net
Ah, sorry, I should've read the whole PR.
 [2001-07-11 10:34 UTC] cheapsalsa at yahoo dot com
Please ignore my first post.  I didn't know exactly what the
problem is.
 [2001-07-14 11:04 UTC] rasmus@php.net
Fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 11:01:28 2024 UTC