Executing freeBSD commands

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
sujin
Forum Newbie
Posts: 2
Joined: Fri Aug 12, 2005 6:54 am
Location: india
Contact:

Executing freeBSD commands

Post by sujin »

How can we execute the freeBSD commands from PHP.
I want to know how to find the PID of a particular process using PHP and to kill that process

Any one please help me..........
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

use anyone of the exec() functions.. like shell_exec(), exec(), etc...
sujin
Forum Newbie
Posts: 2
Joined: Fri Aug 12, 2005 6:54 am
Location: india
Contact:

Post by sujin »

can any one provide the freeBSD command to find the PID of a particular process while using exec()/ system()
etc
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The following script would kill all the programs owned by a certain user... Shouldn't be too hard to tweak it to your needs ;)

http://timvw.madoka.be/programming/bash/killuser.txt
Post Reply