user1272589
user1272589

Reputation: 809

Symfony2 with phpseclib integration

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

Answers (1)

Carlos Granados
Carlos Granados

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

Related Questions