I administer a small
PHPBB forum under the name of
GamersLounge. One of the users asked if we could have
RSS feeds posted as forum entries.
Usually up for a programming challenge and having some spare time I said yes.
So I drummed up a small PHP script, levered in the forum posting and was good to go. Rather than run the script manually every day I thought "I'll stick it in as a
cron job." Simple. But after several dismal attempts I found out that you cannot just run a normal PHP page under cron - cue some hair tearing.
Eventually I found a very helpful page,
Running PHP Scripts with Cron (I think the title says it all).
If your PHP is installed as CGI (as mine is), you add the following line to the very top of your PHP script:
#!/usr/local/bin/php -q
and then use the following command in the cron entry to run it:
php /path/to/your/cron.php
A trial run and smiles all round