note 95455 modified in function.fopen by thiago

From: Date: Mon, 04 Jan 2010 13:07:25 +0000
Subject: note 95455 modified in function.fopen by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164599@lists.php.net to get a copy of this message
if fopen() throws a E_WARNING "failed to open stream: HTTP request failed!" at you when opening a valid URL that you know returns data, i advise you to do the following before calling fopen($url,'r'): <?php ini_set ('user_agent', $_SERVER['HTTP_USER_AGENT']); ?> or anyways, set that 'user_agent' with ini_set() to something valid. thanks, pollita|at|php.net @ http://bugs.php.net/bug.php?id=22937#c64196 , for the clue to this --was-- if fopen() throws a E_WARNING "failed to open stream: HTTP request failed!" at you when opening a valid URL that you know returns data, i advise you to do the following before calling fopen($url,'r'): ini_set ('user_agent', $_SERVER['HTTP_USER_AGENT']); or anyways, set that 'user_agent' with ini_set() to something valid. thanks, pollita|at|php.net @ http://bugs.php.net/bug.php?id=22937#c64196 , for the clue to this http://php.net/manual/en/function.fopen.php

« previous php.notes (#164599) next »