Could anyone explain me how to retrieve the ProcessID from a Process which is started with ssh2_exec? I've tried many things, but its only giving the following message "Resource id #6"
Below is the code where I am struggling with But instead of echo'ing the ProcessID I only get "Resource id #6"
$pid = ssh2_exec($connection, 'cd /home/servers/; nohup ./sc_serv' .$config .' & > /dev/null 2>&1 & echo $!');
This will help you to find the process id