- Create a PHP info page using these lines :
<?php echo phpinfo();?> - Upload to your web server and run it on your browser
- Look at the item ” Server API ” : There are two possible values to come here : 1) CGI 2) Apache
- In my case it was CGI
- Then we have to include the line
#!/usr/bin/php -q(path to PHP installed directory. This you will get it from phpinfo file with item “Configuration File (php.ini) Path”). This should be your first line of the PHP script you have to run Cron. The PHP tag (<?php) have to come after this line. - Then create the crontab using the command ” * * * * * php physical/path/to/your/file.php “
Courtesy : Running PHP Scripts with Cron | HTMLCenter – Web Development Blog
This is quite a hot information. I think I’ll share it on Digg.