Page 1 of 1

Cron Job problem

Posted: Sat Aug 30, 2008 1:26 am
by itsmani1
My files are located at:

/home/outsourcingi/public_html/includes/updates.php

I want to run cron job every 5 minutes on it. i don't know how can i do this?

Current setup:

Code: Select all

*/5 * * * * /home/outsourcingi/public_html/includes/updates.php

Output Email:
/home/outsourcingi/public_html/includes/updates.php: line 1: ?PHP: No such file or directory
/home/outsourcingi/public_html/includes/updates.php: line 2: syntax error near unexpected token `'dizyn@hotmail.com','test','test message...''
/home/outsourcingi/public_html/includes/updates.php: line 2: ` mail('dizyn@hotmail.com','test','test message...');'

Any solution....

Regards,
dizyn

Re: Cron Job problem

Posted: Sat Aug 30, 2008 9:31 am
by VladSun
You should use

Code: Select all

php -q /path/to/your/file.php
to execute a PHP file in shell.

Or you may try adding at the top of your php file the line:

Code: Select all

#!/usr/bin/php
although I'm not sure it will work.
http://en.wikipedia.org/wiki/Shebang_(Unix)