469,631 Members | 1,746 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Weird fopen() problem

I'm having some strange problems using fopen() to fetch website
content.

It seems I can't open URL shorter then certain lenght.

I can open this:
http://groups.google.co.uk/groups/di...=&x=sssssxsssq

But if I delete a character from the end, fopen() failes after 20 sec
and returns strange error:
....failed to open stream: HTTP request failed! \xf4\xff$ in...
....failed to open stream: HTTP request failed! \x94\x93\xeb in...
....failed to open stream: HTTP request failed! \xa0\x82\xfa\xb7@\x18%
in...

I mean what is up with that? Any ideas?

Thanks!!

Server is running Apache 2.0.59, PHP 5.1.6 on CentOS 4.4. The same
thing happened when box was running Fedora Core 5.

This is the code I'm testing with:

<?php
$url = "http://groups.google.co.uk/groups/dir?
lnk=od&h=en&sel=&x=sssssxsssq";
echo strlen($url);
if ($fp = fopen($url,"r"))
{
while (!feof($fp))
{
$buffer = fgets($fp, 4096);
echo $buffer;
}
}
else
{
echo "ERR";
}
?>

Mar 21 '07 #1
0 1451

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Robert Schott | last post: by
6 posts views Thread by Brian | last post: by
4 posts views Thread by phantom | last post: by
14 posts views Thread by vittorio | last post: by
2 posts views Thread by sieg1974 | last post: by
14 posts views Thread by WStoreyII | last post: by
reply views Thread by P Pulkkinen | last post: by
16 posts views Thread by Feanor | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.