$subdomain_host = 'localhost';
$subdomain_user = 'root';
$subdomain_pass = 'root';
$subdomain_path = '/home/';
$domain_path = getcwd();
$connection = ftp_ssl_connect($subdomain_host);
ftp_login($connection, $subdomain_user, $subdomain_pass);
ftp_pasv($connection, true);
ftp_chdir($connection, $subdomain_path);
ftp_put($connection, $subdomain_path."filename", $domain_path."/filename", FTP_BINARY);
ftp_close($connection);