Jump to content

Recommended Posts

I'm trying to run a script that I added to a cron every hour to automate downloading to a local file of external resources but get this error:

Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: No such host is known. in Q:\Webserver\htdocs\testscript.php on line 2

Warning: file_get_contents(http://www.abc.net.au/news/indexes/justin/rss.xml) [function.file-get-contents]: failed to open stream: Unknown error in Q:\Webserver\htdocs\testscript.php on line 2

It doesn't matter what I enter as the file path the error remains the same. I just tried the RSS XML file because I know it's plain text and I can access it fine. I don't think it has anything to do with accessing it via a transparent proxy as the error doesn't mention anything of the sort (I might be wrong however)

In case it makes any difference I'm running Abyss Web Server 2.5, PHP 5.1.4 on Windows XP Pro.

This is the code I was using:

<?php

$remoteFileContents=file_get_contents("http://www.abc.net.au/news/indexes/justin/rss.xml");

$localFilePath="l:";

$localFileName="rss.xml";

$newFileHandle = fopen($localFilePath."/".$localFileName, "w");

fwrite($newFileHandle, $remoteFileContents);

fclose($newFileHandle);

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.