How to make a php script run every 5 min on the server??

Discussion in 'PHP' started by MyFlash13, Jun 22, 2008.

  1. #1
    I know something like this can be done...user cleanup scripts that run monthly for example.

    How can I make a certain script run every 5 min on the server? I know it has something to do with global apps, just not sure.

    Anyone?
     
    MyFlash13, Jun 22, 2008 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    kmap, Jun 22, 2008 IP
    MyFlash13 likes this.
  3. MyFlash13

    MyFlash13 Peon

    Messages:
    137
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot kmap, but I run a Windows server (forgot to mention that!).

    However I have figured it out. This command runs a php script (assuming you're in the php bin folder):

    php -f filename.php

    This command can then be saved as a .bat file. Then a Scheduled Task can be made to run the program every so often.

    Thanks a lot DP!
     
    MyFlash13, Jun 22, 2008 IP
  4. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #4
    yes excellent and this is best way to do it on windows server

    I did not know that you have windows server and i thought most of people use cpanel hosting so i replied accordingly

    Regards

    Alex
     
    kmap, Jun 22, 2008 IP