I've got a PHP script (just a simple script) and I'm trying to get it to run as a cronjob. Every time it executes the PHP script, I receive a mail with the PHP script itself.
How can I resolve this? I've searched on Google a lot but I can't find anything that works.
In your DirectAdmin panel go to 'cronjobs' section, I assume you already configured time interval for your cronjob, so you just need to adjust 'command' option, so try:
First option:
/usr/bin/php -f /home/your_user/public_html/your_script.php
This way you will call php script with php interpreter.
Second option:
lynx -source http://yourdomain.com/your_script.php
This way you will execute text based web browser lynx and open desired url so that php script can be run. Lynx is installed by default on most linux servers.
Also I believe that there is a option in DirecAdmin cronjobs section called 'Prevent email' check that so that you don't receive emails.
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