I am running a command to start a game server via SSH;
$stream = ssh2_exec($connection, 'java -Xmx256M -Xms32M -jar minecraft_server.jar nogui');
What i am trying to do is to get the PID of that process that has just started. The server is remote, hence the SSH2.
I need the PID so that i can assign it to the stop button and so when that is clicked, the PID will be killed.
I can’t seem to find a solution.
Thanks.
As seen on an old question: