문제

I have VPS server with godaddy. I am trying to run a cron job but not able to execute it while I can run the same script from browser. I am pasting the message that I got from godaddy crontab manager. Also I am providing the command that I am using to run in cronjob.

0 0 * * *  /home/fyifuse1/public_html/cronjobs/cron_delete_event.php

I want the script named cron_delete_event.php to run everyday.

The error I am getting in email.

/home/fyifuse1/public_html/cronjobs/cron_delete_event.php: line 1: ?php : No such file or directory /home/fyifuse1/public_html/cronjobs/cron_delete_event.php: line 2: include: command not found /home/fyifuse1/public_html/cronjobs/cron_delete_event.php: line 2: : command not found /home/fyifuse1/public_html/cronjobs/cron_delete_event.php: line 3: syntax error near unexpected token (' /home/fyifuse1/public_html/cronjobs/cron_delete_event.php: line 3: $current_date = Date("Y-m-d"); '

Is there anyone who can help me? Thanks in Advance.

도움이 되었습니까?

해결책

You need to call the PHP executable:

0 0 * * * php /home/fyifuse1/public_html/cronjobs/cron_delete_event.php

You might need to use the full path to PHP which should be available in your control panel or FAQ.

See Godaddy's page for setting up cron jobs

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top