Scheduling PHP script in Windows

1

I have a test environment VM with Windows Server + Xampp .

I need to fire a file ( script.php ) with a schedule every 5 minutes.

What is the simplest and most agile way?

  

Update 1

By Windows "Task Scheduler, the shortest interval is" daily ":

    
asked by anonymous 28.03.2018 / 12:59

2 answers

2

The task should be set up in two steps.

First you should create a simple task starting at 0:00, every day. After that, you go in Avançado (or something similar depending on the OS version) and select Repetir a cada X minutos for 24 hours.

The key here is to find the advanced properties. If you are using the XP wizard, it will only offer the start of the advanced dialog box after you create the task.

In newer versions of Windows (7+):

  • Double click on the task and a properties window will be displayed.
  • Click the Triggers tab.
  • Double-click the trigger details and the Edit Trigger window will appear.
  • In the Configurações avançadas panel, type Repetir tarefa a cada xxx minutes and set Indefinidamente if you require.
  • Finally, click ok.
  • Taking advantage also follows how to execute a php via scheduler:

    C: \ Path \ to \ php.exe -f "C: \ Path \ to \ file.php"

    Font

        
    28.03.2018 / 13:41
    1

    Complementing Otto's response, and from that link

    How did you get XAMPP :

    You should run php.exe , in this case I pulled XAMPP , and the argument would be the caminho/script.php of the file.

        
    28.03.2018 / 13:57