Command does not work if run from php with variables. But if I run it from the terminal or from php (exec or shell_exec) without variables it works. This not works:
$command = 'lftp -c "open -u'.$user.','.$password.' -p xxx sftp://xx.xx.xx.xx; put -O /folder1 folder2/'.$fileName.';"';
exec($command);
var_dump(shell_exec($command)) -> print: NULL
This works:
$command = 'lftp -c "open -u user,password -p 6710 sftp://xx.xx.xx.xx; put -O /folder1 folder2/file.txt;"';
exec($command);
Thanks