Page 1 of 1

killing a program from PHP!

Posted: Fri Dec 19, 2003 6:38 am
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?

Posted: Fri Dec 19, 2003 6:58 am
by patrikG
I've never done anything like it, but I imagine [php_man]exec[/php_man] would do the job for you.

Posted: Fri Dec 19, 2003 7:10 am
by igoy
using COM object maybe,

search PHP manual for that.

Posted: Fri Dec 19, 2003 7:49 am
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

killing a program from PHP!

Posted: Fri Dec 19, 2003 8:15 am
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