Forum Moderators: coopster

Message Too Old, No Replies

Schedule a PHP script on Windows

         

andrewsmd

3:16 pm on Dec 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We run our PHP server on Windows 2000. Right now I have a script that runs at like 4 in the morning on every Mon Wed and Fri. How I have this scripted right now is with a batch file that calls the script like so
start iexplore www.mysite.php. However, this PHP does not echo any html it just goes to another site and downloads a bunch of pdfs. After it is done, I have taskkill /f /im iexplore.exe (which forces internet explorer to close). Does anyone know of a way to call a php script without opening a web browser and still make it execute. If I type php thePathOfMyFile.php it just echoes a bunch of weird characters. Any ideas?

Mahabub

5:44 pm on Dec 30, 2008 (gmt 0)

10+ Year Member



Dear andrewsmd,

You may try schedule task in windows. I only heard about that but didnt know more about it.

Thanks
Mahabub

andrewsmd

5:54 pm on Dec 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know that, the problem is scheduling a task in windows requires some sort of executable file. Right now, I have it scheduled to open the browser and access that site, windows scheduler is how I have it automated right now.

Anyango

6:57 pm on Dec 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



why not execute your PHP executable and send it path of the file to be executed.

Like execute C:\Program Files\php-5.2.6-Win32\php.exe and send it path to your file like
"C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\myFile.php"

[edited by: Anyango at 6:57 pm (utc) on Dec. 30, 2008]