I have a script that reads RSS feeds using fopen & fgets.
When trying to the feed at: http://rss.fok.nl/feeds/nieuws my script hangs until the max_timeout of the PHP is reached.
The thing is:
I tried fread with no success.
any ideas?
Well, it's more of a workaround than an answer, but I had to resort to it. I used the following to switch over to curl, using this function:
function curl_get_file_contents($URL)
{
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
}
I found it here: http://il.php.net/manual/en/function.file-get-contents.php
btw, in case anyone wants to dig deeper, according to other reports of fgets hanging, it seems it has something to do with the 'feof' or lack thereof...