The destination FTP folder has permissions 775, and the FTP user is the administrator user of that shared hosting account and therefore I understand that the permissions to be made The transfer is adequate to write.
The code includes a function that recursively copies the structure of the complete folder, with subfolders, etc ... and this does comply, that is, the folder structure generates it, so I have doubts that the problem is of permissions, but the files never copy them.
The code is simple, but always gives an error:
$ftphost = "ftp.destino.com";
$ftpuser = "usuario-ftp";
$ftppass = "pass-ftp";
$conexion = ftp_connect($ftphost);
$ftplogin = ftp_login($conexion, $ftpuser, $ftppass) or die ("Error FTP login");
$origen = "/ftp.php"; //Esto genera la ruta /home/xxxxx/web/dominio/test/ftp.php
//Comprobado que en destino la ruta actual es la que debe ser.
$destino = "/ftp.movido.php";
if(ftp_put($conexion, $destino, $origen, FTP_BINARY))
echo "OK";
else
echo "ERROR. <br>origen: $origen<br>destino: $destino";
if(ftp_close($conexion))
echo "<br><br>OK: Conexión FTP cerrada<br>";
else
"<br><br>ERROR: No se ha podido cerrar la conexión FTP<br>";
Note: For testing I have also tried with FTP_ASCII mode but the result is the same.