FeedForAll Forum Index  
 Home  •  FAQ  •   Search   •  Register   •  Profile   •  Log in
 Script won't work in a php include View next topic
View previous topic
Post new topicReply to topic
Author Message
dosstx



Joined: 18 Sep 2014
Posts: 6
Location: Moon

PostPosted: Tue Oct 21, 2014 6:59 pm Reply with quoteBack to top

Hi,
I had the following script code working on my old server, but when I apply that same code to the new server we are migrating to, it won't work. It seems there is an issue with the php include and absolute URLS on the new server, but I am not 100% sure.

[code]<?php
$XMLFILE="http://www.myblogfeed.com/?feed=rss2";
$TEMPLATE="sample-template.html";
$MAXITEMS="1";
include('rss2html.php');
?>[/code]

ANy ideas on how to troubleshoot?
View user's profile
dosstx



Joined: 18 Sep 2014
Posts: 6
Location: Moon

PostPosted: Tue Oct 21, 2014 7:00 pm Reply with quoteBack to top

[quote="dosstx"]Hi,
I had the following script code working on my old server, but when I apply that same code to the new server we are migrating to, it won't work. It seems there is an issue with the php include and absolute URLS on the new server, but I am not 100% sure.

<?php
$XMLFILE="http://www.myblogfeed.com/?feed=rss2";
$TEMPLATE="sample-template.html";
$MAXITEMS="1";
include('rss2html.php');
?>

ANy ideas on how to troubleshoot?[/quote]
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2783

PostPosted: Wed Oct 22, 2014 8:45 am Reply with quoteBack to top

Are you getting any specific errors when script tries to execute or is it just yielding blank results?

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
dosstx



Joined: 18 Sep 2014
Posts: 6
Location: Moon

PostPosted: Wed Oct 22, 2014 3:32 pm Reply with quoteBack to top

Tech Support wrote:
Are you getting any specific errors when script tries to execute or is it just yielding blank results?


I found out that my server has 'allow_url_fopen' to 'off'. This may be why it doesn't work since it won't pull in the RSS feed from a remote domain.

Since I can't control the server that the script is on (only ftp access), do you have any other ways I could make this script work? What about pulling the feed in as and using through JSONP? Curl? How would I write it?

Thanks!
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2783

PostPosted: Wed Oct 22, 2014 3:50 pm Reply with quoteBack to top

Look in your rss2html.php file at around line 20 for this:

// Set the following variable useFopenURL to one if you want/need to use
// fopen() instead of CURL or FeedForAll_fopen()
$useFopenURL = 0;

If the value is 0 (as shown), then CURL will be used to fetch the feed files. If the value is 1 then fopen will be used.

Hope that helps.

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
dosstx



Joined: 18 Sep 2014
Posts: 6
Location: Moon

PostPosted: Wed Oct 22, 2014 4:16 pm Reply with quoteBack to top

[quote="Tech Support"]Look in your rss2html.php file at around line 20 for this:

// Set the following variable useFopenURL to one if you want/need to use
// fopen() instead of CURL or FeedForAll_fopen()
$useFopenURL = 0;

If the value is 0 (as shown), then CURL will be used to fetch the feed files. If the value is 1 then fopen will be used.

Hope that helps.[/quote]

Isn't that the default setting for the script? I haven't touched the rss2html.php file. Looks like it wasn't working on my server if it is set like that out-of-the-box. I do know that curl is on, though.
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2783

PostPosted: Thu Oct 23, 2014 9:25 am Reply with quoteBack to top

Yes, the script uses CURL by default, but wasn't sure if yours was still set that way, since you mentioned fopen.

What happens if you try running rss2html from your browser, using something like this (you will need to fix the actual server address and path to the rss2html file)?

http://www.yourserver.com/pathtorss2thml/rss2html.php?XMLFILE=www.myblogfeed.com/?feed=rss2&TEMPLATE=sample-template.html

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
dosstx



Joined: 18 Sep 2014
Posts: 6
Location: Moon

PostPosted: Thu Oct 23, 2014 4:49 pm Reply with quoteBack to top

Ooops. I found out that it's actually "allow_url_include" that is set to "off". I'm trying to get my server admin to set it to "on", but due to security reasons, I don't know if that will be allowed. Lets hope they can turn it on....
View user's profile
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme