Warning: ssh2_exec()
: 09 stycznia 2010, 18:07
Witam mam taki problem, chcę używać takiego skryptu
Używam Debiana 5.0
Mam zainstalowane apache 2 php5 i bibliotekę
Ale wpisuje w przeglądarce ip_serwera/plik_z_tym_skryptem.php i na stronie mam taki komunikat
I nie mam pojęcia co mam robić
Kod: Zaznacz cały
<?php
$polaczenie = ssh2_connect("188.116.33.41", "22");
ssh2_auth_password($polaczenie, "marta", "123abc");
if ($polaczenie)
{
ssh2_exec("cd ~/1");
ssh2_exec("killall hlds_run");
ssh2_exec("screen -A -m -d ./hlds_run -game cstrike +port 27010 +maxplayers 16 +map de_dust +exec server.cfg");
ssh2_exec("logout");
echo("<font color='green'>Zresetowano</font>");
}
else
{
echo("<font color='red'>Nie połączono</font>");
}
print_r($polaczenie);
var_dump($polaczenie);
?>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
Mam zainstalowane apache 2 php5 i bibliotekę
Kod: Zaznacz cały
root@vz2010:~# apt-cache search libssh2
libssh2-1 - SSH2 client-side library
libssh2-1-dbg - SSH2 client-side library (debug package)
libssh2-1-dev - SSH2 client-side library (development headers)
Kod: Zaznacz cały
Warning: ssh2_exec() expects at least 2 parameters, 1 given in /var/www/reset.php on line 6
Warning: ssh2_exec() expects at least 2 parameters, 1 given in /var/www/reset.php on line 7
Warning: ssh2_exec() expects at least 2 parameters, 1 given in /var/www/reset.php on line 8
Warning: ssh2_exec() expects at least 2 parameters, 1 given in /var/www/reset.php on line 9
ZresetowanoResource id #2resource(2) of type (SSH2 Session)
I nie mam pojęcia co mam robić