Addil
Addil

Reputation: 105

Return output of screen command and display using php

I have a game server running through the screen command and I was wondering whether there is a way to see the contents of the screen through a PHP webpage.

At the same time I also need a way to inject commands back into the screen console.

This is what I've tried so far:

$output = shell_exec('screen -r public');
echo "<pre>$output</pre>";

However this returns an errors saying

Must be connected to a terminal.

Upvotes: 0

Views: 302

Answers (1)

Daniel
Daniel

Reputation: 1253

You can't use screen via shell_exec, as it is an interactive program and requires a TTY (input/output terminal).

Upvotes: 1

Related Questions