1
votes

My website is hosted on Amazon server, I have a PHP that sends emails to the user, What I did is setup a cron job

3 * * * * php LINK to Abc.php

SO that it would run after 3 minutes. BUt I am not receving any mail that shows the script is not running.

  • I checked the logs that showed /var/syslog

CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)

Over my head. Then I tried this command to check the cron job crontab-l still nothing happend. anyone who can help me in debugging

EDIT1 It says in log files now..

CRON) info (No MTA installed, discarding output)

If I do PHP Path to file from terminal.. it runs fine and I receive an email as well... Please help in this regard

2
cron job or email problem? - user557846
@Dagon it is cron job,, because if I run the script in browser it works fine - user1765876
have you set the MAILTO= in the crontab file? - user557846
@Dagon all the script is present in the php file..why MAILTO in crontab file? :) - user1765876
if you add the MAILTO Variable then any error will be emailed to you, otherwise you are not going to see it - user557846

2 Answers

1
votes

Try 3 * * * * /var/lib/php5 /path/to/Abc.php

0
votes

Check that the link you are passing to PHP is not a web link which means it doesn't start with HTTP, rather it should be path to the PHP file.