I need to create a cron job which will execute a php file after every 5 sec on my Win7 machine.
I have Tomcat installed on my machine also apace server for php in uwamp server and i have knowledge of c,c++,java,javascript and vbscript. Also i have some experience in Visual Basic 2005.
Can you please tell me is there any way to execute a php file running on my local win7 machine using any given language that i knew.
Windows scheduler is not the solution for me, because i want my php file should run at every 5 sec or 1 sec. Please if you the way to do this let me know the method.

I'll be grateful for help or any suggestion.

3 Years
Discussion Span
Last Post by rch1231


The PHP CLI as its called ( php for the Command Line Interface ) is called php.exe It lives in c:\wamp\bin\php\php5.x.y\php.exe ( where x and y are the version numbers of php that you have installed )When you know the path you could add an entry in the Task Scheduler and use the following as the command line to call the php program. Before you add it to the scheduler try it from the command line and make sure that it works.

For the example lets say that php.exe is in c:\wamp\bin\php\php5.3.1\php.exe and the php script you want to run is called c:\users\myuser\Documents\myscript.php then your command in the task scheduler should look like:

c:\wamp\bin\php\php5.3.1\php.exe c:\users\myuser\Document\myscript.php

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.