Welcome Guest, Not a member yet? Register   Sign In
SimplePie Problems on my webhost
#1

[eluser]maeksm[/eluser]
Hi Guys,

I hope you can help me out with this. I'm trying to get my videos on youtube using simplepie and it works here on my localhost. I get the rss feed and well.. it just works. But when I put the site online I get a 404.

Now I got this in my controller
Code:
$this->load->library('SimplePie');
$this->simplepie->set_feed_url($feed_url);
$this->simplepie->handle_content_type();
//$this->simplepie->set_cache_location(APPPATH.'cache/youtube');
$this->simplepie->enable_cache(false);
$this->simplepie->init();

$this->data['rss_items'] = $this->simplepie->get_items();
And then I load the view. I tried to die before I call the init() and I can see the die. But when I put the die behind the init() I get the 404 page.

Here you can see what I mean http://sexy.sammy.nu/videos if you need more information to help me out, just tell me.

I'm using SimplePie version 1.1.1 I just copied the library in to my library folder and changed the extension from inc to php. Oh and if you are wondering why $feed_url doesn't has a value yet, it's just because I left it out for this post. I have a real working url in my code.

Thanks in advance
#2

[eluser]TheFuzzy0ne[/eluser]
I know it sounds like an obvious question, but in the interest of having the simple things covered, what is the name of the controller file, controller class, and what is it's path in relation to your Web root?

Or are you absolutely certain that it's nothing to do with any of that? Also, have you tried assigning a route to that controller?
#3

[eluser]Clooner[/eluser]
Hi Maeksm,

This is probably because simplepie tries to open the connection with curl. Try forcing it to use fsockopen.

Kind regards,

Clooner.
#4

[eluser]maeksm[/eluser]
Woooaah Clooner thanks a million! After hours and hours of debugging the damn thing, it finally works.

Cheers,

Maeksm
#5

[eluser]Unknown[/eluser]
hey maeksm! I am having the same problem!!! could you post the solution you have found?
I don't understand very well what Clooner suggest...
And... what about not having a cache for rss? which are the advantadges/disadvantages about it?
Well, thank you a lot!

Regards,
Tomy.
#6

[eluser]Clooner[/eluser]
Hey Tomygniter you should edit simplepie.inc file (or .php file) and set the force_sockopen to true

So edit the file simplepie.php and change this on line 443
Code:
var $force_fsockopen = false;
into this
Code:
var $force_fsockopen = true;

Hope this works...

Caching should make you server load less...

Regards,

Clooner
#7

[eluser]maeksm[/eluser]
Hi Tomygniter,
I guess Clooner already explained the solution a bit clearer. The reason I had cache false, was because I thought it could be part of the problem. I read somewhere that people had problems with setting the cache location. But since I found the problem I'm caching the rss again.

Cheers,

Maeksm




Theme © iAndrew 2016 - Forum software by © MyBB