Forum Moderators: coopster

Message Too Old, No Replies

Circular redirect warning

When trying to open a remote file

         

zulu_dude

8:16 pm on Jan 7, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



When trying to open a remote file with file_get_contents(), I get this error message:

Warning: file_get_contents() [function.file-get-contents]: Circular redirect, aborting.

Does anyone have any idea what could be causing this? The PHP to load the file is extrememly simple:
$page = file_get_contents("http://www.example.com/page.php");

When trying it on any other page, this works fine. It seems to be just this specific page that I'm having a problem with. I've never seen this error before...

inveni0

8:19 pm on Jan 7, 2006 (gmt 0)

10+ Year Member



Are you trying to load the contents of the file running the script?

zulu_dude

8:23 pm on Jan 7, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



Nope, the file is on another server completely.

mm1220

8:33 pm on Jan 7, 2006 (gmt 0)

10+ Year Member



Is allow_url_fopen enabled in php.ini?

Also, have you tried using:

$page = file_get_contents(urlencode("http://www.example.com/page.php"));

zulu_dude

8:47 pm on Jan 7, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks for the suggestions... allow_url_fopen is enabled and when I try the urlencode, it says that the file wasn't found.

I've used my code to open other files and have never had a problem. This is the first site where I've encountered this problem.

henry0

9:29 pm on Jan 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check this one out [bugs.php.net]

zulu_dude

9:42 am on Jan 8, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks Henry,

I saw that site while trawling the net looking for an answer... I've got a fairly up-to-date version of PHP, so I would have expected it to include all the latest patches.

Anyways, I will try patching my php install and hopefully that will sort out the problem. Thanks to all of you for the help and suggestions...