I have connected with my server using phpseclib
and I want to run 3 commands in a particular folder but I am facing several issues in this library.
1 I am getting
stdin: is not a tty bash:
error after every command.I did google and found a solution to add
$ssh->enablePTY();
then i am not able to see my output its returning 1 or 0.
2 After adding $ssh->enablePTY(); when i am trying to run another command i am facing
If you want to run multiple exec()'s you will need to disable (and re-enable if appropriate) a PTY for each one
So i have added $ssh->enablePTY();
and $ssh->disablePTY();
before and after of every command then i can see only 1 and 0 not output of my command.
3 I want to run 3 commands back to back in a particular folder so executed
echo $ssh->exec('cd /home/my/public_html/testmags/; composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /home/my/public_html/testmags/');
but I am facing composer: command not found
.
I have spent 2 days on this but unable to solve any of these problems.
Small help will be greatly appreciated.
Thanks In Advance :)