Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Simplepie Help Needed

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27810
    James R
    Member

    Hi all,

    First time posting here but I’m long-time viewer of the screencasts.

    I’m about to throw my mac out the window with the Simplepie trouble I’m having. I’m trying to display two feeds on my php pages but once I go one directory deep eg: mywebsite.com/work/anotherpagecallingsimplepiefeeds.php

    I get a warning:

    Warning: ./cache is not writable. Make sure you’ve set the correct relative or absolute path, and that the location is server-writable. in D:Domainsmywebsite.comwwwrootincsimplepie.inc on line 1780

    The cache is fully writable and I never get this warning on any of the pages located in the root directory where the cache folder resides. I presume this is some kind of error related to file that wants to display the feed not being in the same directory as the cache? So I tried using:

    Code:
    $feed->set_cache_location($_SERVER[‘DOCUMENT_ROOT’] . “/cache”);

    thinking this would solve my issue but sadly, no.

    Here’s my code:

    Code:
    enable_cache(true);
    $feed_twitter->enable_cache(true);

    //provide the caching folder
    $feed->set_cache_location($_SERVER[‘DOCUMENT_ROOT’] . “/cache”);
    $feed_twitter->set_cache_location($_SERVER[‘DOCUMENT_ROOT’] . “/cache”);

    //set the amount of seconds you want to cache the feed
    $feed->set_cache_duration(1800);
    $feed_twitter->set_cache_duration(1800);

    //init the process
    $feed->init();
    $feed_twitter->init();

    //let simplepie handle the content type (atom, RSS…)
    $feed->handle_content_type();
    $feed_twitter->handle_content_type();

    ?>

    Directory structure:

    wwwroot/inc/simplepie.inc
    wwwroot/cache/
    wwwroot/pagecallingsimplepiethatworks.php
    wwwroot/work/pagecallingsimplepisthatdoesnotwork.php

    I’d be very grateful for any help or ideas. Maybe I’m missing something blatantly obvious?! :oops:

    Thanks,
    James

    (I should mention that the feeds are being displayed but so is the frustrating warning message)

    #70254
    James R
    Member

    Thanks for the reply but I gave that a go there and no joy:

    Warning: ./cache is not writeable. Make sure you’ve set the correct relative or absolute path, and that the location is server-writable. in D:Domainszoost.iewwwrootincsimplepie.inc on line 1780

    #70427
    heysep
    Member
    Quote:
    Dot-slash-cache (./cache) means that the cache directory is in a location that is relative to the page calling SimplePie – not simplepie.inc itself. Dot-slash-cache is not relative to your root (like slash-cache (/cache) is).

    a simple

    Code:
    $feed->set_cache_location(“/cache”);

    should do?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.