Answer the question
In order to leave comments, you need to log in
Exec() does not execute SFTP command, what is the reason?
From the console - it works, through exec () - no.
$pass = 'QQQQQ';
$server = '10.78.78.222';
$path = '/home/bitrix/www/test/file.txt';
exec('sshpass -p '.$pass.' sftp [email protected]'.$server.':'.$path.' '.$path, $D);
print_r($D);
Answer the question
In order to leave comments, you need to log in
What's wrong with built-in functions?
php.net/manual/ru/function.ssh2-connect.php
php.net/manual/ru/function.ssh2-sftp.php
Full paths to programs must be specified
$ whereis sftp
sftp: /usr/bin/sftp
$ whereis sshpass
sshpass: /usr/bin/sshpass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question