0

How can I run a php file or execute a mySQL query automatically depending on the time? For example, by 12mn I want my server to automatically run somefile.php.

More: I have a LAMP setup.

1
  • 2
    In unix, you can try use Cron. Other suggestion is create a .txt file that store last execution time, but is need too many visits, or a "infinite while" (server need support) Commented Nov 29, 2011 at 13:05

4 Answers 4

3

You are looking for the Cron jobs. you can schedule the PHP file to be executed with the cron and cron will take care of rest.

If you are on LAMP platform, check out how to setup cron.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes you can, just read something about cronjobs

Comments

0

You can do this by using Cron :

https://help.ubuntu.com/community/CronHowto

ex :

* */12 * * * php /cron/script.php 

Comments

0

If you don't want to setup a cron job (or if you can't) you can use a service like WebBasedCron

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.