The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using the linux screen command with php

Discussion in 'General Discussion' started by z-hoster, Feb 8, 2014.

  1. z-hoster

    z-hoster Member

    Aug 8, 2005
    Likes Received:
    Trophy Points:
    Hey guys!
    I have a world of warcraft private server hosted on my server and i use the linux screen command to stop/start/restart the server. I would like to make a php module on my website that would allow me to do it from there with out having to use SSH. This way, my game staff will also have access to restart if needed.

    So what i did so fare is:
    $screen = exec('screen -r');

    In SSH, that would output this:
    But but instead of geting the above, the exec command returns "Must be connected to a terminal."

    I saw a few work arrounds to this problem but i am unsure how to applie them to a cpenel envirement. Any help on this would be appreciated ;-)
    #1 z-hoster, Feb 8, 2014
    Last edited: Feb 8, 2014
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    Is there any reason you prefer to use screen when running a command that should complete on it's own right away? It's typically used in cases where the user's connection might time out before a command finishes. Also, is the account assigned normal shell access or jailed shell access?

    Thank you.

Share This Page