$remote_path is recognized as a filename, not a directory name.
If you know how to send files to the specified directory, please contact us.
(Example) Files such as \home\user\test.csv are created.
test.csv is not sent to the directory \home\user.
if(!ssh2_scp_send($connection,$local_path.$fileName,$remote_path.$fileName,0644)){
// error handling
}
Environment: xampp + PHP 7.1
php cakephp scp
The third argument of ssh2_scp_send is always the path of the file (not the directory).
reference:
ssh2_scp_send-PHP Manual
ssh2_scp_send(
resource$session,
string$local_file,
string$remote_file,
int$create_mode=0644
) :bool
© 2025 OneMinuteCode. All rights reserved.