It should be that both adding the line to the very top of your php file and the ‘alternative’ setup through cron would work in exactly the same way. Personally i’ve always just done it through cron, and I do it differently than the wiki.
For the first example, you add that line to the top of your php script, and I believe it has to go n the very first line above anyting else, then you have a crontab entry like this:
*/5 * * * * /home/username/path/to/cron.php
Cron opens up the cron.php file, and ‘sees’ that it’s a php file, and then uses php to excute the file.
The way I like to do things is the ‘alternative’ example. We leave the php file all alone and just tell cron to use php for the file, like this:
*/5 * * * * /usr/local/bin/php /home/username/path/to/cron.php
I’m not quite sure what you’re talking about uploading. Are you talking about uploading a text file that has your cron command in it, and typing “crontab cron.txt” ? If that’s the case, then you would just upload that file to your home directory - the directory you’re in when you first FTP in.
You can also edit your cron file by simply typing “crontab -e”. What’s the difference between these two? When you enter a command for cron to run, it must all appear on one line, it’s can’t wrap onto a 2nd line. A funny qurk of the default setup is that the text editor you use when you type crontab -e has wrapping turned on my default. Becuase of this it is simpler for many people to use notpad to write the command, upload it to their home direcotry, and import that file into crontab.
One work of caution about importing the text file, when you do that it overwrites anythign else in your crontab. So if late you decided to add another command, make sure you don’t delete your first one.
What’s the difference between between my above example and usign wget? wget is a " non-interactive network downloader". Wget will apparently download and excute the file. While you could use this in your situation, I believe it’s mainly used for grabbing a file from an other server.
I think that’s all of your questions, please feel free to ask for cliarification or more questions.
art.googlies.net - personal website