amarques Posted March 10, 2008 Share Posted March 10, 2008 Hi, I have a piece of code on one server that tries to open a file on another server. I define the handle as: $checklastserverlistupdate=fopen ("http://www.example.com/xxxxxxxx/yyyyyyy/serverlistupdated.php", "rb"); Annoyingly, when I execute the script, sometimes it makes the connection, but usually I get a ...failed to open stream: HTTP request failed! HTTP/1.1 404 in... error. The file in example.com is available and can be reached on a browser. Any ideas on why this happens? Could it be that the path or filename is too long? Any suggestions are welcome. Thanks. Link to comment https://forums.phpfreaks.com/topic/95528-http-request-failed-http11-404/ Share on other sites More sharing options...
Northern Flame Posted March 11, 2008 Share Posted March 11, 2008 i dont think you can use http requests in fopen because its a big security issue.... Link to comment https://forums.phpfreaks.com/topic/95528-http-request-failed-http11-404/#findComment-489146 Share on other sites More sharing options...
l0ve2hat3 Posted March 11, 2008 Share Posted March 11, 2008 http://www.digiways.com/articles/php/httpredirects/ Link to comment https://forums.phpfreaks.com/topic/95528-http-request-failed-http11-404/#findComment-489152 Share on other sites More sharing options...
l0ve2hat3 Posted March 11, 2008 Share Posted March 11, 2008 or this might be better: $url = "http://www.example.com"; $str = file_get_contents($url); Link to comment https://forums.phpfreaks.com/topic/95528-http-request-failed-http11-404/#findComment-489155 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.