[function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized
I am periodically getting this error, i.e it is only happening at random times, a
task - fopen with basic http authentication.
$auth_header = 'Authorization: Basic '.base64_encode("$user:$password"); $f = fopen($url, $open_mode,false, stream_context_create( 'http'=>array( 'header' => array($auth_header,$some_other_header,$some_yet_header), ), ));