Jump to content

Getting Process ID Number


Rhiknow

Recommended Posts

How do I get the process id number into my PHP code.

 

I'm running a 'tail -f' command to monitor a file. How do I kill the tail process once I'm finished with it? I've just discovered a whole load of tails running when I run 'pgrep tail'!

 

$command="tail -f ".$file_being monitored." 2>&1";
$handle=popen($command, 'r');

while(!feof($handle))
{
   //monitor the file, take actions etc.

 

Any help would be much appreciated.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/165397-getting-process-id-number/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.