PHP - How to check if process is running with multiple parameters
<p>I know how to check if one instance of process is running but how do I check a particular process running with different parameters for example</p>

<pre><code>/usr/local/bin/foo --config /home/config1.txt
/usr/local/bin/foo --config /home/config2.txt
</code></pre>

<p>Following code checks only process name, how do I check if a process is running with a particular parameter?</p>

<pre><code>function is_process_running ($process_name) {
    $result = array();
    exec("/sbin/pidof {$process_name}", $result);
    if(is_array($result) &amp;&amp; isset($result[0]) &amp;&amp; $result[0] &gt;= 1) {
        return true; 
    }
    return false;
}

 is_process_running('/usr/local/bin/foo --config /home/config1.txt') returns true
 is_process_running('/usr/local/bin/foo --config /home/config3.txt') returns false
</code></pre>
