I use the ssh2_scp_send PHP ssh2_scp_send to transfer files from one server to another. The interesting thing is that if I write the resolution in octal form (i.e. 0644), then everything works fine. If I instead put it in quotation marks or used a variable, this no longer works.
To be clearer: This works: ssh2_scp_send($conn, $localFile, $remoteFile, 0644);
NOT working: ssh2_scp_send($conn, $localFile, $remoteFile, "0644");
NOT working: $permission=0644;ssh2_scp_send($conn, $localFile, $remoteFile, $permission);
Does anyone know why this is so?
source share