...

View Full Version : Shell



Extreme43
06-23-2005, 11:20 AM
i dont know much about unix but i need to do this so...
how would i run
KILL processname
in unix from a php script?
like in windows you would create a .bat file with KILL processname or whatever then exec(); (although i cant get exec to work lol)

Celtboy
06-24-2005, 07:30 AM
<?php
$procName = "ftpd";
echo exec('kill ' . $procName);
?>


-Celt

jasong
06-24-2005, 07:55 AM
If your permissions won't allow exec(); , I believe
system(); will do the same thing.

Extreme43
06-25-2005, 03:14 AM
ok thanks but,
im making a control panel for shoutcast and their will be many sc_serv.exe processors running
how would i get the process id for an individual process
would it output the process id when i start sc_serv.exe?

bcarl314
06-25-2005, 04:14 AM
Check out the man pages for ps.

example:

$> ps aux

Will show you all the processes on the system.

So look in the man pages for the right flag to get the pid, then pipe that to the command.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum