0
<?php
   error_reporting(E_ALL);
   ini_set('display_errors', '1');

   $file_handle = fopen("http://www.example.com/", "r");

?>

The above script results in

Warning: fopen(...) failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request ...

Notes
(i) allow_url_fopen is open for both local/master value
(ii) I'm running the php script on xampp/windows 8
(iii) get_headers(), http_get(), and file_get_contents() works with no error.

Please tell me what could be wrong?

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149

0 Answers0