1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

RSS feeds issue related to Magpie

Discussion in 'XML & RSS' started by freebird789, Apr 1, 2010.

  1. #1
    Hi,
    I'm a newbie to PHP and I guess somebody else installed the Magpie RSS and I have to figure our the error that it is showing on our webpage
    Warning: require_once(magpierss/rss_fetch.inc) [function.require-once]: failed to open stream: No such file or directory in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 5

    Fatal error: require_once() [function.require]: Failed opening required 'magpierss/rss_fetch.inc' (include_path='.:/usr/local/php5/lib/php') in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 5

    I have all the 4 important files and extlib in a folder named magpierss and my php.ini is outside of it.

    This is the code inside my column1.inc file
    <?php
    define('MAGPIE_CACHE_DIR', '/tmp/magpie_cache');
    define('MAGPIE_DIR', 'magpierss/');
    $rss_url= "http://www.envirolink.org/animalnews.rss";
    require_once(MAGPIE_DIR.'rss_fetch.inc');
    $rss = fetch_rss('http://www.envirolink.org/animalnews/atom.xml');
    $rss_i=0;
    echo "<br/>";
    foreach ($rss->items as $rss_item ) {
    $item_desc = $rss_item['description'];
    $item_title = $rss_item['title'];
    $item_url = $rss_item['link'];
    $item_date = substr($rss_item['pubdate'], 0, 16);
    echo "<p class=\"rss\"><span class=\"rss_date\">$item_date </span><a href=\"$item_url\" target=\"_blank\"><span class=\"rss_link\">$item_title</span></a><span class=\"rss_desc\">&nbsp;$item_desc</span></p>";
    $rss_i++;
    if($rss_i>8) break;
    }
    echo "<p class=\"rss_source\">RSS feed source: <a href=\"".$rss->channel['link']."\" target=\"_blank\"><span
    class=\"rss_chlink\">".$rss->channel['title']."</span></a></p><br/>";
    ?>
    Could somebody please shed some light on this issue?
     
    freebird789, Apr 1, 2010 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    ok I got around this by including the relevant files through another file above the magpie directory. Maybe the same will work for you. And I did not set any of the magpie related defines like MAGPIE_DIR or the cache dir.

    EDIT: Checked my local install/setup of that and it's close to yours. Except I have the 4 files in a /system folder in the /magpie folder and extlib is inside of /system with /magpie/cache as the other. I think you need to put them into a /system folder along with extlib. But I will go download a fresh copy and see if that's the out of the box layout first.

    Nope, you're setup looks right. I'll post the code I used in another post if you want.
     
    Last edited: Apr 1, 2010
    shallowink, Apr 1, 2010 IP
  3. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Could you please post the code ,it would greatly help me. Also I have four column files such as column 1.inc ...Column 4.inc (column.inc is the one I pasted in my previous thread) are under home\inc\home\inc. Were exactly do these files reside inside the magpie folder or do they appear somewhere else? If you could also let me know of where exactly the php.ini file should go,it will be very helpful. I sincerely do appreciate your help in this issue. Thanks again
     
    Last edited: Apr 1, 2010
    freebird789, Apr 1, 2010 IP
  4. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #4
    so where exactly is the /magpie directory in relation to the /inc/home/inc directory? odds are that's the problem.
     
    shallowink, Apr 1, 2010 IP
  5. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yes, I too was thinking about that... For this portal animal rights ,there is a folder named animal rights. The magpie directory is under the animalrights/magpierss and these column files (1,2,3,4)reside under animalrights/home/inc/home ... Hope I explained it properly...
     
    freebird789, Apr 1, 2010 IP
  6. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #6
    ya so you need to either move magpie to /home/inc/home or change the magpie rss directory to something like ../../../magpierss , think that's right.
     
    shallowink, Apr 1, 2010 IP
  7. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I moved the folder to under the home directory but had no luck and got stuck with the same errors.
    The second error :
    Fatal error: require_once() [function.require]: Failed opening required 'magpierss/rss_fetch.inc' (include_path='.:/usr/local/php5/lib/php') in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 4

    I was wondering if the fatal error message is trying to convey that it is unable to find the correct path on the server and is asking to include that path usr/local/php5/lib/php on the server. Do you think my assumption is right? Coz I don't think my magpie files are causing a problem since I am able to browse to the rss fetch file through the browser without any problems. Any advice would be appreciated. Thanks
     
    freebird789, Apr 1, 2010 IP
  8. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #8
    Nope. Seen this before plenty of times. The error is that it can not locate the magpie files. And since its obviously a problem, you can rectify it by declaring the full path to the magpie files. Do you know the full path to your home directory? ok let's just skip that. Here's what you can use to get the correct path , save your current file as a backup and create a new one with this :

    
    <?php
    $path = $_SERVER["DOCUMENT_ROOT"];
    echo $path;
    $magpie_path = $path . "Home/inc/home/magpierss/";
    
    define('MAGPIE_DIR', $magpie_path);
    require_once(MAGPIE_DIR.'rss_fetch.inc');
    $rss = fetch_rss('http://www.envirolink.org/animalnews/atom.xml');
    $rss_i=0;
    echo "<br/>";
    foreach ($rss->items as $rss_item ) {
    $item_desc = $rss_item['description'];
    $item_title = $rss_item['title'];
    $item_url = $rss_item['link'];
    $item_date = substr($rss_item['pubdate'], 0, 16);
    echo "<p class=\"rss\"><span class=\"rss_date\">$item_date </span><a href=\"$item_url\" target=\"_blank\"><span class=\"rss_link\">$item_title</span></a><span class=\"rss_desc\">&nbsp;$item_desc</span></p>";
    $rss_i++;
    if($rss_i>8) break;
    }
    echo "<p class=\"rss_source\">RSS feed source: <a href=\"".$rss->channel['link']."\" target=\"_blank\"><span
    class=\"rss_chlink\">".$rss->channel['title']."</span></a></p><br/>";
    ?>
    Code (markup):
     
    shallowink, Apr 2, 2010 IP
  9. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Now get these errors
    /var/chroot/home/content/e/n/v/envdomains/html
    Warning: require_once(/var/chroot/home/content/e/n/v/envdomains/htmlHome/inc/home/magpierss/rss_fetch.inc) [function.require-once]: failed to open stream: No such file or directory in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 7

    Fatal error: require_once() [function.require]: Failed opening required '/var/chroot/home/content/e/n/v/envdomains/htmlHome/inc/home/magpierss/rss_fetch.inc' (include_path='.:/usr/local/php5/lib/php') in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 7

    Any ideas?
     
    freebird789, Apr 2, 2010 IP
  10. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #10
    do you have a directory named htmlHome? try changing the 3rd line to:

    $magpie_path = $path . "/Home/inc/home/magpierss/";
     
    shallowink, Apr 2, 2010 IP
  11. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Added the slash but still I get the error ...

    /var/chroot/home/content/e/n/v/envdomains/html
    Warning: require_once(/var/chroot/home/content/e/n/v/envdomains/html/Home/inc/home/magpierss/rss_fetch.inc) [function.require-once]: failed to open stream: No such file or directory in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 7

    Fatal error: require_once() [function.require]: Failed opening required '/var/chroot/home/content/e/n/v/envdomains/html/Home/inc/home/magpierss/rss_fetch.inc' (include_path='.:/usr/local/php5/lib/php') in http://www.animalrightsportal.net/Home/inc/home/column1.inc on line 7
     
    freebird789, Apr 2, 2010 IP
  12. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #12
    you wouldn't happen to be using godaddy hosting?
     
    shallowink, Apr 2, 2010 IP
  13. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    We are using go daddy.... Is that causing the problem?
     
    freebird789, Apr 2, 2010 IP
  14. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #14
    your real path is this :

    /home/content/e/n/v/envdomains/html/Home/inc/home/magpierss/

    according to godaddy. So let's try this...
    just change this line :
    $magpie_path = $path . "/Home/inc/home/magpierss/";

    to:

    $magpie_path = "/home/content/e/n/v/envdomains/html/Home/inc/home/magpierss/";
     
    shallowink, Apr 2, 2010 IP
  15. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I still get the same error. I've copied the column.inc file with all changes made so that you can see if there is anything wrong...

    One more thing.. This issue came up when they changed to a new server..

    <?php
    $path = $_SERVER["DOCUMENT_ROOT"];
    echo $path;
    $magpie_path = $path."/home/content/e/n/v/envdomains/html/Home/inc/home/magpierss/";

    define('MAGPIE_DIR', $magpie_path);
    require_once(MAGPIE_DIR.'rss_fetch.inc');
    $rss = fetch_rss('http://www.envirolink.org/animalnews/atom.xml');
    $rss_i=0;
    echo "<br/>";
    foreach ($rss->items as $rss_item ) {
    $item_desc = $rss_item['description'];
    $item_title = $rss_item['title'];
    $item_url = $rss_item['link'];
    $item_date = substr($rss_item['pubdate'], 0, 16);
    echo "<p class=\"rss\"><span class=\"rss_date\">$item_date </span><a href=\"$item_url\" target=\"_blank\"><span class=\"rss_link\">$item_title</span></a><span class=\"rss_desc\">&nbsp;$item_desc</span></p>";
    $rss_i++;
    if($rss_i>8) break;
    }
    echo "<p class=\"rss_source\">RSS feed source: <a href=\"".$rss->channel['link']."\" target=\"_blank\"><span
    class=\"rss_chlink\">".$rss->channel['title']."</span></a></p><br/>";
    ?>
    Thanks again for helping me out with this issue
     
    freebird789, Apr 2, 2010 IP
  16. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #16
    get rid of the $path variable :
    $magpie_path = "/home/content/e/n/v/envdomains/html/Home/inc/home/magpierss/";
     
    shallowink, Apr 2, 2010 IP
  17. freebird789

    freebird789 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Thanks for the reply.

    I think I fixed the problem.
    I had removed the path variable(realized this after I posted the reply to you) and also replaced the first half of the path with the qualified url to show something like this
    $magpie_path = "http://www.animalrightsportal.net/Home/inc/home/magpierss/"; and changed this to show $rss = fetch_rss('http://www.envirolink.org/animalnews.rss');

    Thanks for your dedicated help. Really appreciate it
     
    freebird789, Apr 2, 2010 IP