killing a program from PHP!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Miss.Apache
Forum Newbie
Posts: 10
Joined: Sun Dec 14, 2003 11:49 am

killing a program from PHP!

Post by Miss.Apache »

HI :),

i want the PHP to kill student's program (written in C, compiled by Borland C++ Compiler) after fixed seconds (let's say 40), to terminate the run if there is a problem in it.

How could i do that in my PHP code (that called the compiler and compile the student's code?

Is the windows API inform that?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

I've never done anything like it, but I imagine [php_man]exec[/php_man] would do the job for you.
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

Post by igoy »

using COM object maybe,

search PHP manual for that.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

The API can do a lot. I recommend using that. I did see a page that had something to do with process killing.

[php_man]w32api[/php_man]...check out the user notes too, especially mine
akcrum
Forum Newbie
Posts: 1
Joined: Fri Dec 19, 2003 8:15 am

killing a program from PHP!

Post by akcrum »

you'll probably need to identify the shell command that would kill the other program and then use php's system() function to invoke that command from your php script.

ref: http://www.php.net/manual/en/function.system.php
Post Reply