2

I am trying to pull in some posts from a remote wordpress site with simplepie. I have installed the library and put what I think is the right code at the top of the .php page.

Right now my it looks like:

<?php
require_once('../autoloader.php');

$feed = new SimplePie();

$feed->set_feed_url('http://simplepie.org/blog/feed/');

$feed->enable_cache(true); 
$feed->set_cache_location('cache'); 
$feed->set_cache_duration(1800);

$feed->init();

$feed->handle_content_type();

?>    {doc type}

But when I load my page it tells me:

Warning: require_once(../autoloader.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/27/9279927/html/LatestHOPE.php on line 2

Fatal error: require_once() [function.require]: Failed opening required '../autoloader.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/27/9279927/html/LatestHOPE.php on line 2

What's up with that? Why is it telling me this? I have autoloader.php in my root directory.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
mkob
  • 55
  • 1
  • 7

1 Answers1

1

You have it in your root directory!? That is a strange location. However, if that is true, use

require_once('/autoloader.php');

Perhaps you mean in your home directory? For that use

require_once('/home/<your username>/autoloader.php');
wallyk
  • 56,922
  • 16
  • 83
  • 148
  • Yea, root, I put it there because it couldn't find it when I put it in the php folder with require_once('../php/autoloader.php'); Thanks so much! – mkob Oct 12 '12 at 19:18
  • I have started a troubleshooting checklist for this frequent error here : stackoverflow.com/a/36577021/2873507 – Vic Seedoubleyew Apr 12 '16 at 16:40