title: PHP5 giving failed to open stream: HTTP request failed error when using fopen
body: <p>This problem seems to have been discussed in the past everywhere on google and here, but I have yet to find a solution.</p>
  
  <p>A very simple fopen gives me a </p>
  
  <blockquote>
    <p>PHP Warning:  fopen(<a href="http://www.google.ca" rel="noreferrer">http://www.google.ca</a>): failed to open stream: HTTP request failed!".</p>
  </blockquote>
  
  <p>The URL I am fetching have no importance because even when I fetch <a href="http://www.google.com" rel="noreferrer">http://www.google.com</a> it doesnt work. The exact same script works on different server. The one failing is Ubuntu 10.04 and PHP 5.3.2. This is not a problem in my script, it's something different in my server or it might be a bug in PHP.</p>
  
  <p>I have tried using a user_agent in php.ini but no success. My allow_url_fopen is set to On.</p>
  
  <p>If you have any ideas, feel free!</p>