Nginx nie działa ssh2
: 28 lutego 2012, 20:55
Witam.
Zainstalowałem serwer www - nginx, następnie ssh2.
Mój przykładowy skrypt:
Po jego wykonaniu pokazuje się: lub jeżeli wykorzystam linię drugą skryptu to:
Następnie zastopowałem nginxa i zainstalowałem serwer apache i na nim działa prawidło, wiec to coś z nginxem.
Proszę o pomoc.
Zainstalowałem serwer www - nginx, następnie ssh2.
Mój przykładowy skrypt:
Kod: Zaznacz cały
<?php
//if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
// log in at server1.example.com on port 22
if(!($con = ssh2_connect("xxxxx", 22))){
echo "fail: unable to establish connection\n";
} else {
// try to authenticate with username root, password secretpassword
if(!ssh2_auth_password($con, "root", "xxxxx")) {
echo "fail: unable to authenticate\n";
} else {
// allright, we're in!
echo "okay: logged in...\n";
// execute a command
if (!($stream = ssh2_exec($con, "ls -al" ))) {
echo "fail: unable to execute command\n";
} else {
// collect returning data from command
stream_set_blocking($stream, true);
$data = "";
while ($buf = fread($stream,4096)) {
$data .= $buf;
echo $data;
}
fclose($stream);
}
}
}
?>
Kod: Zaznacz cały
błąd 500
Kod: Zaznacz cały
function ssh2_connect doesn't exist
Następnie zastopowałem nginxa i zainstalowałem serwer apache i na nim działa prawidło, wiec to coś z nginxem.
Proszę o pomoc.