ssh_exec, isn't working. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: ssh_exec, isn't working. (
/showthread.php?tid=412769)
ssh_exec, isn't working. -
iGetty - 03.02.2013
I'm creating a panel for my free-hosting plan and I would just like to know; what's the problem with this?
ssh2_exec($connection, 'cd /home/igetty/samp/');
sleep(1);
ssh2_exec($connection,'screen ./samp03svr');
If anybody can help, thank you so much!
Re: ssh_exec, isn't working. -
SchurmanCQC - 03.02.2013
http://php.net/manual/en/function.ssh2-exec.php
http://php.net/manual/en/function.sleep.php
I don't see anything wrong with those. Please explain your problem better.
EDIT: (OFFTOPIC) Check your PMs.
EDIT 2: Debug this.
PHP код:
$sshCmd = "cd /home/igetty/samp/";
$sshCmd2 = "screen ./samp03svr";
echo("Output for command $sshCmd:<br><samp>");
$stdout_stream = ssh2_exec($connection, $sshCmd); //Execute the command and collect the raw IO stream.
$stderr_stream = ssh2_fetch_stream($stdout_stream, SSH2_STREAM_STDERR); //Fetch the error stream!
while($line = fgets($stderr_stream)) { flush(); echo $line."<br>"; } //Read the lines and print them synchronously!
echo("</samp><br>Output for command $sshCmd2:<br><samp>");
$stdout_stream = ssh2_exec($connection, $sshCmd2); //Execute the command and collect the raw IO stream.
$stderr_stream = ssh2_fetch_stream($stdout_stream, SSH2_STREAM_STDERR); //Fetch the error stream!
while($line = fgets($stderr_stream)) { flush(); echo $line."<br>"; } //Read the lines and print them synchronously!
echo("</samp><br>END OUTPUT");
Re: ssh_exec, isn't working. -
iGetty - 03.02.2013
Quote:
Originally Posted by Schurman
http://php.net/manual/en/function.ssh2-exec.php
http://php.net/manual/en/function.sleep.php
I don't see anything wrong with those. Please explain your problem better.
EDIT: (OFFTOPIC) Check your PMs.
EDIT 2: Debug this.
PHP код:
$sshCmd = "cd /home/igetty/samp/";
$sshCmd2 = "screen ./samp03svr";
echo("Output for command $sshCmd:<br><samp>");
$stdout_stream = ssh2_exec($connection, $sshCmd); //Execute the command and collect the raw IO stream.
$stderr_stream = ssh2_fetch_stream($stdout_stream, SSH2_STREAM_STDERR); //Fetch the error stream!
while($line = fgets($stderr_stream)) { flush(); echo $line."<br>"; } //Read the lines and print them synchronously!
echo("</samp><br>Output for command $sshCmd2:<br><samp>");
$stdout_stream = ssh2_exec($connection, $sshCmd2); //Execute the command and collect the raw IO stream.
$stderr_stream = ssh2_fetch_stream($stdout_stream, SSH2_STREAM_STDERR); //Fetch the error stream!
while($line = fgets($stderr_stream)) { flush(); echo $line."<br>"; } //Read the lines and print them synchronously!
echo("</samp><br>END OUTPUT");
|
Just did mate!
Come on the TeamSpeak buddy, we'll talk there.
Thanks for the help m'dear! <3