Reputation: 547
I'm fairly new to PHP. I need to run a function on my PHP site on a daily basis. I have seen posts on how to do this under Linux, but I'm running the PHP site on Windows Server 2012 under IIS. How can I create a PHP function and then run it at a certain time each day?
Upvotes: 2
Views: 2573
Reputation: 2220
You could use Task Scheduler on the server to run a batch file that runs the PHP script via command line at a regular interval, which i hope should solve your problem.
Upvotes: 1
Reputation: 77
Run Cron Job on PHP Script, on localhost in Windows
Create script.bat file with below Code
"C:\wamp\bin\php\php5.4.12\php.exe" -f "C:\wamp\www\website\my_process.php"
Change wamp path to your iis path
Download & Install Zcron From Below Link
http://www.z-cron.com/download.html
Create New Task select your script.bat file and set timer
Upvotes: 0