I want to start a program with SSH using PHP, which works fine, but now I want to kill the screen with PHP, but the only thing I know is the name of the screen. How do I find out the screen ID (automatically)?
You can use the environment variable
Initially we're sitting in a terminal window, not inside of a screen session.
Spin up a screen session:
Connect to it:
Inside screen session:
Killing a session
With the name of the session you can kill it using
You can also use the number there too.
Confirm that its been killed:
Do you mean the
You can use that to kill the process:
Alternatively, if you can identify the php process with ps, then it's parent id will be screen and you can kill that.