Maybe a silly question, but I'm trying to get a cronjob to work. Although this could be a question for serverfault I think its also a SO-question.
Anyway: I have set up a cronjob to be executed everey 1 minute of every hour, day (number), day (name) and month. The given command is: /home/easybr01/domains/easybranding.nl/public_html/cronjobs/test.php
Which is nothing more than a file with a simpe php function mail(to, subj, content, hdrs)
to test if it works... but the mails never come in.. and they're not in a spam folder eighter..
Does someone know what's wrong?? I figured this should be pretty straight forward...
You should indicate ${PATH_TO_PHP} into the cronjob, like :-
* * * * * ${PATH_TO_PHP} /home/easybr01/domains/easybranding.nl/public_html/cronjobs/test.php
Alternatively, you can make the script executable (ex. mod 744),
and place #!${PATH_TO_PHP}
into first line of your PHP script, like :-
#!${PATH_TO_PHP}
<?php
// remanding code
?>
For starters, you need to run the PHP command-line interpreter, not just point to a PHP file. If you're giving a command to cron, it needs the whole command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With