Reputation: 25
I've a PHP based app. We've to run a PHP file (say xyz.php) once daily to send emails. We use Cron job in cPanel to run that file everyday in the morning. I've setup my email as cron email so that I get notified every time the cron job is executed. It runs perfectly in the morning - sends the data which is required correctly and I also get notified via email every morning that cron job executed successfully.
That PHP file's URL (abc.com/xyz.php) if entered in browser manually will also send emails.
Now coming to the problem part - The email IDs in the PHP file start getting emails at random times and sometimes 30-40 emails a day. The emails are incomplete and incorrect. I don't get any notification email that cron job has executed. So, my guess is the PHP file is accessed by something which triggers the emails. I've checked access logs in the cPanel but there's nothing in there.
The app is hosted on Hostgator, if that helps.
Please help. Thanks!
Upvotes: 0
Views: 423
Reputation: 2314
Some exmplanations:
Someone may execute it manually
Also - WRITE some code into you php file that will log HOW and WHEN it was executed - that will allow you to further test what is happening.
Upvotes: 1
Reputation: 2361
this may happen when you have include
your abc.com/xyz.php
on some other php
files , which get executed when the php
pages is called via browser and some part of form get executed, also you wont get mail notofications for this type of exectutions
Upvotes: 1