I setup a cron job (in Virtualmin based of Webmin) for execute a simple test script and it work well.
The cron command used is:
/usr/bin/php -q /home/myuser/domains/mysite.com/public_html/mailtest.php
The url is:
www.mysite.com/mailtest.php
The content of "mailtest.php" is:
<?php
$to = "your@mail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "any@any.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Now I tried to execute another script and I have of course modify path and file name who is simply:
/usr/bin/php -q /home/myuser/domains/mysite.com/public_html/myfolder/myscript.php
But here I don't know why my script is not executed. When I go to his related url "www.mysite.com/myfolder/myscript.php" the script is well executed.
The content of "myscript.php" is:
<?php
require_once(dirname(__FILE__).'/includes/includes.php');
$mails = POP3Mailer::ProcessMails();
require_once($BASE_PATH.'/includes/footer.php');
?>
Somebody have an idea why the cron won't fire with "myscript.php" ???
Thank for your time