PHP cannot read external RSS

PHP cannot read external RSS

Posted by: uzforum
Posted on: 2006-10-08 08:12:00

Hi everyone,

I recently installed elgg (elgg.org), and there is a function which imports external feeds. So that thingy is not working. I contacted developers of the script, and they told me that the problem is with, I quote:

"It's likely to be a proxy issue - PHP may not actually be able to read external web services. You may be able to adjust Snoopy's settings in /lib/snoopy/ to change this behaviour."

Can anyone comment on this? Is it possible for me to edit this snoopy thingy in shared hosting?

Re: PHP cannot read external RSS

Posted by: sdayman
Posted on: 2006-10-08 08:27:00

It may be trying to do a PHP Include, which is not permitted for security reasons. Without seeing the error, or the source code, it's difficult to tell.

I've substituted curl in my source code to pull in "external" info:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.external.com/path/file.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);

-Scott

Re: PHP cannot read external RSS

Posted by: rlparker
Posted on: 2006-10-08 11:13:00

In reply to:

It may be trying to do a PHP Include, which is not permitted for security reasons.Without seeing the error, or the source code, it's difficult to tell.


Actually, PHP includes *are* permitted, and are often used by scripts to share common code between application components. Allow_url_fopen being disabled, for security reasons, is what prevents you from "including" a remote file via http, but you *can* use includes as long as you load them from your server using a path, etc (see the wiki).Not meaning to "nit-pick" here (and I do think you describe what the original poster needs), but I wouldn't want him/her to go about thinking that includes are not permittedwink

You are completely correct that without seeing the code or the error message we can't be sure what is happening. That said, I also think the solution you indicated is most likely what is needed. - his circumstances seem to call for the use of curl to retreive the foreign site's data.

--rlparker



Tags: shared hostingphplibrssquoteorgweb services