Quote:
Originally Posted by karimali831
Not sure if this is such thing but can you manipulate SSH commands using php? I want this so my members can stop/start servers without the need of a client or login root access.
|
It would all depend on exactly what it is you're after achieving. PHP can use either the system() call, or the exec() call but would require to be enabled in the php.ini, though given the security risks, these functions are usually disabled.
PHP Code:
system('/home/user/shoutcast/sc_serv sc_serv.ini > /dev/null 2>&1') // Start Shoutcast server - output to /dev/null
PHP Code:
system('/home/user/shoutcast/sc_serv sc_serv.ini') // Start Shoucast server - output all to web browser
PHP Code:
exec('/home/user/shoutcast/sc_serv sc_serv.ini', $status) // Start Shoutcast server - output to variable $status ($status will become an array containing every line of output from the command)
I've only used shoutcast as an example as Dan mentioned it in the post above, but these are all possible ways of achieving it.