I’m looking for some advice.
Rignt now i’ve got a bunch of php scripts that i’ve scheduled through cron. They run on my local machine doing stuff like pulling stuff out of a mysql db and sending automated emails. To run them I just have something like this in crontab: 0 7 * * 1 /usr/bin/php /phpscripts/script.php
I need to migrate all of those scripts to a Windows machine. I’m planning to use the Windows Task Scheduler to run the scripts, but how can I run the actual php scripts locally? From what I understand you need something like xampp to run the apache server? I guess what I need is a Windows equivalent of /usr/bin/php in crontab.
Installing PHP
You don’t have to install
xammp, you can install PHP alone, have a look ate the windows PHP installation guide:If you prefer installing XAMP, you can run PHP script after locating the
php.exewith the-fflag:Running the PHP file
After you have PHP installed, check Command Line PHP on Microsoft Windows manual for information on how to run the script. On the page there is explanation of how to make the php file executable, so you could run it as:
Make sure you are using an administrative account to run the command. Otherwise you might have permissions problems. more info at the Introduction to using PHP on the command line
Scheduling the task
Go to
Start -> Programs -> Accessories -> System Tools -> Scheduled Tasks,