PHP and windows

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

Threaded View
I am running a site using php, mysql and xampp on an xp system. On
this system we run shoutcast and sam broadcaster to stream out a radio
show. Sometimes sambroadcaster (a dos program) restarts and causes
shoucast to stop. Is there a way in php to determine if a program is
running on a windows xp server and if not restart it?

Bill H

Re: PHP and windows

Quoted text here. Click to load it

sounds like a job for the task scheduler to me.

Re: PHP and windows

Quoted text here. Click to load it

This sounds like you need to figure out how to configure "sam
broadcaster" properly, in which case, this is not a PHP issue.  
Failing that, you can use PHP's program execution functions to run
shell commands.

The command I'd use to determine which processes are running is
`tasklist`.  Run `tasklist /?' on a Win32 shell terminal to figure
out how to use it.  The closest POSIX/UNIX equivalent would
probably be `ps'.

To (re)start the server, look up the documentation for it, which
should explain how to start from the command line.  Once you
determine this, you can just use the program execution functions in
PHP for your problem.


Quoted text here. Click to load it

I'm not sure I follow you.  The task scheduler wouldn't do anything
by itself, you still have to have a program that does something.  
Judging by the OP's issue

$email = str_replace('sig.invalid', '', $from);

Anonymous (1984 IOCCC winner):
int i;main()"];read('-'-'-',i+++"hell\
o, world!\n",'/'/'/'));}read(j,i,p)

Site Timeline