[SOLVED] - Getting error with fopen on locahost
Posted: Wed Jun 07, 2006 3:20 pm
Can someone help me out on this?
I am using a snippet of code from Sitepoint that opens up their RSS feed file and parse the XML into something readable. I have the file in the test folder of my local development machine and am calling the files using http://localhost/test/readsitepoint.php.
My problem is that the call to fopen returns the following error:
I have checked my php.ini file for allow_url_fopen and found it to be...
When I save the XML feed to a local file and fopen it from a local folder, it opens fine and does what it is supposed to do. But for some reason my localhost PHP won't open a file given a full URL. I tried this with the DevNet feed and got the same error.
As always, any help would be appreciated.
I am using a snippet of code from Sitepoint that opens up their RSS feed file and parse the XML into something readable. I have the file in the test folder of my local development machine and am calling the files using http://localhost/test/readsitepoint.php.
My problem is that the call to fopen returns the following error:
Here is the calling code...Stupid PHP Error wrote:Warning: fopen(http://www.sitepoint.com/rss.php): failed to open stream: Bad file descriptor in c:\program files\apache group\apache\htdocs\test\readsitepoint.php on line 59
Code: Select all
<?php
$fp = fopen("http://www.sitepoint.com/rss.php","r")
or die("Error reading RSS data.");
?>Code: Select all
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = OnAs always, any help would be appreciated.