0

I'm trying to install proftpd over PHP with phpseclib.

I'm using this command to start the installation:

$sshconid->exec("apt-get install proftpd-basic -y");

This part works fine, but the installtion wont complete. If I try to uninstall/install the proftpd over a terminal, after execing the php code it shows me that I have to type in this command to continue the installtion:

dpkg --configure -a.

I belive this error comes from the missing terminal, because the dialogue which comes up after typing this command is an graphical window, its called package configuration.

Can anyone help me with this problem, please? Thanks.

Kevin
  • 41,694
  • 12
  • 53
  • 70

1 Answers1

1
<?php
include('Net/SSH2.php');

$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password')) {
    exit('Login Failed');
}

echo $ssh->read('username@username:~$');
$ssh->write("apt-get install proftpd-basic -y\n"); // note the "\n"
echo $ssh->read('username@username:~$');
$ssh->write("dpkg --configure -a.\n");
echo $ssh->read('username@username:~$');
?>

does that do the trick?

gregane
  • 11
  • 1
  • No, I'm sorry, this doesen't work. The installtion won't start with your code. –  Aug 04 '14 at 20:01