Mohammad Tanveer
Mohammad Tanveer

Reputation: 69

task scheduling in php on windows

I want to execute a php script after every one minute in background on windows OS, for this purpose i am using windows task scheduler in which i am giving the path of a php file after choosing Internet Explorer EXE, it works fine and after every minute opens that page in browser window and performs my wanted task.

Now the issue is that i do not want to open that browser window in front, i want this process to happen in background or at least close that browser on the fly after performing its task, i have also tried a .bat file for this process and i am killing the browser process after calling that php file, what happens is it closes the browser after opening it but does not execute that php file and does not perform my wanted task.

so in first way it performs task but keeps browser window open and in second way it closes window but does not perform task. My requirement is to execute that php code in background without opening any window in front and i want all this to happen on windows not linux. Any help from your side is welcome.

Upvotes: 2

Views: 2839

Answers (3)

DisgruntledGoat
DisgruntledGoat

Reputation: 72580

Assuming Apache on Linux you can set up a scheduled cron job of this command:

wget -q -O - http://example.com > tmp.txt 

EDIT: Read your question a bit more thoroughly (walls of text are never conducive to good answers). As andreas says there is wget for Windows.

Upvotes: 2

andreas
andreas

Reputation: 289

Use php.exe as mentioned, or use wget for windows.

Upvotes: 2

user229044
user229044

Reputation: 239551

If the PHP is running on the same machine as your scheduler job, you can install WAMP (I'd imagine you already have?) and execute PHP from the command line:

C:\wamp\bin\php\php5.3.0\php.exe <path to your script>

Upvotes: -1

Related Questions