2

I am attempting to set up a CRON job on XAMPP in Windows but I am having some trouble. I have the timing set up so that it should run every 5 minutes, and this part works because I see my command prompt pop up every five minutes.

This is the code for the CRON.BAT file that runs. Both locations are correct for their respective files.

C:\xampp\php\php.exe  C:\xampp\htdocs\codeigniter214\update_simplepie_cache.php

This is my update_simplepie_cache.php file. I'm pretty sure this is the part that's failing, because the MySQL database isn't updating even though the feeds have new items in them. I tried to follow the SimplePie instructions, but it hasn't worked so far.

<?php
    $this->load->library('rss');
    $feed = $this->rss;
    $cache_location = 'mysql://root@127.0.0.1:3306/news_test';  //  change to your cache location
    $feed->set_feed_url('http://www.theverge.com/rss/frontpage', 'http://gigaom.com/tag/rss-feeds/feed/');
    $feed->set_cache_location($cache_location);
    $feed->set_cache_duration(9999999);   // force cache to update immediatlely
    $feed->set_timeout(5);   // optional, if you have a lot of feeds a low timeout may be necessary
    $feed->init();
?>

Can anyone see what I'm missing here? Thank you.

Drizzit12
  • 169
  • 2
  • 19
  • What happens when you run your script manually? – Revent Sep 28 '13 at 19:25
  • Still doesn't work. Even when running under admin. Command prompt flashes, but the database doesn't update. – Drizzit12 Sep 28 '13 at 19:58
  • SimplePie does not cache in the database by default although you can tell it to. By default it caches files in the "cache" directory. – Revent Oct 08 '13 at 22:30
  • 1
    `$feed->set_cache_duration(9999999);` looks like "_force cache to update after 115 days, 17 hours, 46 minutes and 39 seconds_". If you want to force cache to update _immediately_, you could try `$feed->set_cache_duration(0);` – galeksic Oct 08 '14 at 14:21

0 Answers0