Forum Moderators: coopster

Message Too Old, No Replies

Running .PHP in scheduled task

         

Etruscan

10:36 pm on Oct 10, 2006 (gmt 0)

10+ Year Member



I've got an odd problem - and I think I'm thinking about the solution all wrong, so I thought I'd bring it before you all and see how you would handle it.

Running a blog on WAMP, and I have a PHP file that generates my RSS feed in the admin section. Typically I enter a new article then run the RSS generator script following it.

...now I've adopted a system whereby I can future date articles. However, until the date arrives, they won't show up on the page or in the RSS feed... which is good. However, I can only generate the RSS feed manually. Therefore, until I go back and manually run the RSS generator script, the article will not be included in the feed (though it will appear on the page).

I'm not sure how Wordpress or other blogging software does it... but I wanted to schedule a task to run the RSS generator PHP script nightly. That way it will pick up any future dated articles as they appear, and automatically.

Question: I'm not sure how best to automatically run a PHP script, especially as it's in a password protected location. Suggestions?

eelixduppy

11:02 pm on Oct 10, 2006 (gmt 0)



You have to use a cron. Here are some related links

Good luck :)

Etruscan

11:06 pm on Oct 10, 2006 (gmt 0)

10+ Year Member



I'm running it under Windows though... but in the meantime, I've found the answer. :)

php -f <filename.php>

That'll run beautifully in a scheduled task. Thanks for the Linux help though! Eventually I'll get that LAMP server up, and those links will come in handy.

eelixduppy

11:37 pm on Oct 10, 2006 (gmt 0)



Ooops...sorry about that. I should have asked first. Glad you got it, though! ;)

[edit]
>>>Running a blog on WAMP
LOL
I should have known**
[/edit]