- This topic is empty.
-
AuthorPosts
-
January 30, 2010 at 8:42 pm #27810James RMember
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.phpI’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)
January 31, 2010 at 4:50 pm #70254James RMemberThanks 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
February 3, 2010 at 1:21 am #70427heysepMemberQuote: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?
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.