Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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



share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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