Jump to content

Recommended Posts

Hello everybody

 

I have set up a cronJob but it keeps sending error report to my mail.

 

These are the errors:

(I have removed the full server path before the cron.php which is home/..../)

cron.php: line 1: ?php: No such file or directory

cron.php: line 2: /backup: is a directory
cron.php: line 3: access-logs: command not found
cron.php: line 4: access-logs: command not found
cron.php: line 5: access-logs: command not found
cron.php: line 6: access-logs: command not found
cron.php: line 7: access-logs: command not found
cron.php: line 8: access-logs: command not found
cron.php: line 9: access-logs: command not found
cron.php: line 10: access-logs: command not found
cron.php: line 11: access-logs: command not found
cron.php: line 12: access-logs: command not found
cron.php: line 13: access-logs/: is a directory
cron.php: line 16: //: is a directory
cron.php: line 17: syntax error near unexpected token `('
cron.php: line 17: `$mydir = dirname(__FILE__);'

 

 

 

 

What shall I do?

 

Link to comment
https://forums.phpfreaks.com/topic/277225-cron-job-problem/
Share on other sites

If you want to execute a PHP file in the cron, you need to specify the path to the PHP command line interpreter. If you're using linux, this is generally "/usr/bin/php"

 

So the cron would look like:

 

* * * * * /usr/bin/php /path/to/file.php

 

Replacing * for whatever time values you actually want

Link to comment
https://forums.phpfreaks.com/topic/277225-cron-job-problem/#findComment-1426905
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.