Why would SSH commands through Putty work differently to those via PHP's phpseclib?
I'm writing a script to automate deployment from my windows development PC to a shared hosting server. I am getting different results depending on whether I execute the commands via Putty or PHP (both running on my PC) . In putty, when I log in to the server via SSH, I can run commands like: cd /www/ ls -la #outputs contents of /www But when I do it via PHP with phpseclib, as below, any cd commands are totally ignored: <?php require_once __DIR__.'/vendor/autoload.php'; use phpseclib\Net\SSH2; $ssh = new SSH2('ssh.mydomain.com'); if (!$ssh->login('mydomain.com', 'mypassword')) { trigger_error(