I need a valuable suggestion that I have to run the PHP script at the scheduled time daily to update some fields in database and to send automated email.

How I can do this? Is it possible to write some service in XAMP server? To run the script daily at scheduled time?

I have no idea how to update database and send email automatically at the scheduled time. Can any one share some ideas or concepts?

I am using PHP, MySQL, Linux.

2 Answers 2


Easiest way is to set up a cronjob that triggers a php script in php-cli.




If you have dedicated or virtual hosting then you should be able to set up a cron job that calls PHP via command line. Actually the easiest way I've found is to use wget to fetch it as a web page, which helps if you are using frameworks or rewriting URLs instead of one single PHP file. Something like:

wget -o /dev/null "http://example.com/page"

You can use wget from any (Linux) computer anywhere. You can do similar from your own PC if you like using Scheduled Tasks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.