Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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 Technical Support Community Manager
    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice