scheduling a PHP program for after hours run.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
WinXP Pro, PHP4, Webserver=xitami, Mysql

I have written a php program which I would like to schedule for a daily

The program queries a database for about to be due quality system tasks
(this is a manufacturing org and we have scheduled events, a big list
actually) and emails the about to be due requirements.

But it appears the php program must run from within a browser.

What I would like to do is, schedule the php program via Win scheduler

Is this doable, or am I using the wrong program (php).  I am old and
have no memory.

I want this automatic, I don't want to have to log on and run this


Re: scheduling a PHP program for after hours run.

Dross wrote:

Quoted text here. Click to load it

Hi Bob,

PHP just loves to be within a webcontext, but you can run it from  
commandline too.

Try to find the cgi version of PHP.
(named php-cgi.exe I think)
Maybe you have it already in your PHP.dir
Otherwise download it.

Open a commandprompt, go to the PHP directory where the CGI resides.

try something like  
php-cgi -v

if it answers with versionnumber: good.

Now try to invoke the script you want to shedule by hand.
Once you have it running from commandline, try to shedule it.
(Pay attention to userrights and such if sheduler runs it. But I must admit  
I know not much of the sheduler, so maybe I talk bull.)

Good luck

Erwin Moller

Re: scheduling a PHP program for after hours run.

I knew that, thanks for sparking my memory.

Got it, works great.

Re: scheduling a PHP program for after hours run.

*** Dross wrote/escribió (19 Aug 2005 06:11:25 -0700):
Quoted text here. Click to load it

Unless your scripts relies on client-side JavaScript, you can easily
rewrite it to work as shell script and send output to a file. Then, it's
trivial to program its execution: since Windows scheduller is a service,
you don't have to log in.

PHP has a command-line version, but regular version works fine too in
command line.

-- Álvaro G. Vicario - Burgos, Spain
-- - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group

Site Timeline