Reputation: 809
I want to integrate phpseclib with Symfony2
This is how we can use it with 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');
Any ideas how it can be done or if you know any other ways to use ssh with Symfony2 to exec commmands
Upvotes: 2
Views: 1138
Reputation: 11351
Add this to your composer file:
require "phpseclib/phpseclib=~2.0.0"
Then run composer update. This should download the phpseclib library and add it to the autoloaded namespaces. You will then be able to use it in your project
Upvotes: 4