1

I am wondering how to start a screen session from PHP, I have tried with shell_exec(), system() and passthru(), but no avail.

I have gotten the screen session started for the execution time of the script, but after it has finished loading, it kills the screen session it just created. (By starting a screen session and executing 'screen -list' in the same script)

Any ideas?

1 Answer 1

1

you'll want to bg(background) and disown the process because *nix uses a process tree such that if the parent of a process terminates all of its children terminate too unless the parent disowns the child.

depending on your shell, appending an & to the end of the command line you execute should be sufficient to do this for you.

Normally you open screen in a terminal window (and i believe screen has builtin commands to background and disown itself) so this wouldn't matter

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.