View Full Version : Shell

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)

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


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

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?

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


$> 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.