Are there any possibilities to connect to server via ssh using php in tidesdk. I'm trying to use
$session = ssh2_connect($server, 22);
But an error occurred
Fatal error - Call to undefined function ssh2_connect()
I'd recommend using phpseclib, a pure PHP SSH implementation. eg.
<?php
include('Net/SSH2.php');
$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password')) {
exit('Login Failed');
}
echo $ssh->exec('pwd');
echo $ssh->exec('ls -la');
?>
The fact that it's pure-PHP means it's ultra-portable. Unlike the libssh2 extension you're currently trying to use.
Have you installed the SSH2 extension?