Hey guys!
The thread is a little old but it fits to my problem. I tried to connect to a remote server via ssh2_connect() but I don't receive any response. I know that connecting is possible because with the same parameters I get a connection using a shell.
<?php
class Login{
private $connection;
public function connect($server, $port, $login, $passwd){
if (!function_exists("ssh2_connect")){
return false;
}
if(!($this->connection = ssh2_connect($server, $port))){
return false;
}
else {
if(!ssh2_auth_password($this->connection, $login, $passwd)) {
return false;
}
else {
return true;
}
}
}
}
$ssh = new Login();
if($ssh->connect('some.sever.com', 22, 'username', 'somepasswd')){
echo "connected...";
}
else{
echo "no connection";
}
?>
display_errors is on and error_reporting is set to E_ALL. The page keeps loading and loading. Connect to other servers works fine...
I check user data, firewalls, other servers and now I'm running out of ideas. Could somebody help me?