Hi all
I am getting the following error with readfile:

Warning: readfile() [function.readfile]: URL file-access is disabled in the server configuration in /home/u7/zzjynz5usy/ssss.com/html/news/news_index.php on line 144

can anyone help me in clearing this problem.

I am using the readfile() function for generating rss feeds.

my code is like this:
readfile("http://www.webrss.com/get_mysite.php?mysiteId=10786");

Recommended Answers

All 4 Replies

It looks like your hosting provider has disabled the necessary option to allow this function to work, which is allow_url_fopen (read about this option in the PHP manual here).

If you want to read the contents of a remote file, try using the PHP curl library; there's an example page in the PHP manual here about how to use it.

I hope this answers your question.

i could not find te correct solution.it is saying the same error after using the function.can u give me some other solution.i will be thankful for your advice.

Make a new file called php.ini in the directory where this script runs from and inside it put:

allow_url_fopen = "1"

;)

just get an rss reader script,
rss2php
rss2html
or any of the thousand others,
and plug the news feed directly into your page
then you wont have to try to borrow the rss off the free site

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.