I have 2 websites on the same linux server, but as is logical, there are different folders, with this code I can copy files within the same domain so to speak. How can I copy a file from one domain to another? and in case I have to use ftp, I can only use sftp.
$fichero = 'ejemplo.txt'; $nuevo_fichero = 'carpeta/ejemplo.txt'; // esta es la carpeta dentro del mismo dominio //me gustaria poder escribir algo como: /var/www/html/carpetadestino/ejemplo.txt if (!copy($fichero, $nuevo_fichero)) { echo "Error al copiar $fichero...\n"; }