chigley Posted March 9, 2008 Share Posted March 9, 2008 Hey all. I've been having some problems when using the mail() in a PHP script being executed with a Cron job. When I type the filename into my browser, I receive the email. Yet for some reason the email is not sent when the file is executed by the Cron demon. Any suggestions? Cheers Quote Link to comment Share on other sites More sharing options...
trq Posted March 9, 2008 Share Posted March 9, 2008 Is the actual script being executed? Can we see your crontab entry? Quote Link to comment Share on other sites More sharing options...
chigley Posted March 9, 2008 Author Share Posted March 9, 2008 php /path/to/file.php I know the script is definitely being executed because the database is being updated. Cheers Quote Link to comment Share on other sites More sharing options...
chigley Posted March 9, 2008 Author Share Posted March 9, 2008 OK well I decided to try doing it the way it's worked in the past on another project (I didn't realise I was doing it differently to last time): /usr/local/bin/php /path/to/file.php And now I get errors along these lines: Warning: include(../includes/mysql.php): failed to open stream: No such file or directory in /home/zignet/public_html/sitefunctions/update.php on line 3 Warning: include(): Failed opening '../includes/mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zignet/public_html/sitefunctions/update.php on line 3 Advice appreciated Quote Link to comment Share on other sites More sharing options...
chigley Posted March 9, 2008 Author Share Posted March 9, 2008 Right well I've fixed the include errors, but the email code still isn't working.. EDIT: Whoop managed to get it to work Where's the "Topic Solved" button gone? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.