any ideas why I cant open remote files on one host, but can on another?
can anyone help?
I have tried many methods to open remote files, and they all seem to fail with the same type of error.
They only fail on this host, but oddly, they work on another host I use, which leads me to believe its something to do with the host's setup.
The support people for the host dont think it is their problem tho, so Im looking for guidance as to what it could be, so I can get back to them with details, or find a workaround that works.
I have a script that shows the phpinfo() at lsblogs.com/x3.php if that helps anyone by being able to see the php setup.
Examples of what fails (but do work on another host) are
quote:
<?php
$res = file_get_contents('http://www.google.com/robots.txt');
echo $res;
?>
which fails with
quote:
Warning: file_get_contents(http://www.google.com/robots.txt): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /home/content/l/s/b/lsblogs/html/x4.php on line 3
also fopen fails
example code extract, works on one domain, not on the other...
quote:
$testurl = "http://www.google.com/robots.txt"; $fp = fopen( $testurl, "r" ) or die( "See error above, fopen failed for " . $testurl );
produces
quote:
Warning: fopen(http://www.google.com/robots.txt): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /home/conten etc etc
Same for get_meta_tags, and it does not matter what url I use, I have tried many (all local urls work fine, its just remote ones!)
Does anyone know what the problem is?
Does anyone know a way to open a remote file that would work on this host? Or what to tell the host to check/alter so it will work?
thanks in advance!
sofy60 posted this at 06:01 — 27th September 2004.
They have: 16 posts
Joined: Jan 2004
permissions need to be changed by non working host
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.