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?
Asked
Active
Viewed 2,210 times
2 Answers
1
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.

Zachary Craig
- 2,192
- 4
- 23
- 34
-
Thanks, I'll give it a try. – FlyFish Feb 27 '17 at 11:39
0
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

JaNaM SoNi
- 77
- 4
-
Thanks, but I can't install ZCron. This is not for personal use which is against the TOS of ZCron. Is there another way to do this? – FlyFish Feb 23 '17 at 16:16