| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | Running a PHP file in Cron Job Hi Does anyone know how to run a php file in cron job every hour? what is the command i put in the cron job? right now i have the following and it does not work 55 * * * * php q- /home/play/public_html/cron.php What is the right command for this? Thanks |
| |
| | #3 (permalink) |
| NamePros Regular Join Date: Oct 2006
Posts: 963
![]() ![]() | Your cron entry is generally right. That way it will run the command hourly five minutes before the full hour. If it doesnt work nonetheless, your user is either not allowed to run cron jobs or the command cannot be executed. It is better to use absolute paths like /path/to/the/php/directory/php -q /path/to/script.php |
| |
| | #8 (permalink) | ||||||||||||||||
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/programming/357798-running-a-php-file-cron-job.html
| ||||||||||||||||
| |