使用PHP将文件从一台服务器移动到另一台服务器的最佳方法是什么? [英] What is the best way to move files from one server to another with PHP?

查看:129
本文介绍了使用PHP将文件从一台服务器移动到另一台服务器的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个运行PHP脚本的CRON,该脚本又将XML文件(保存非敏感信息)从一台服务器移动到另一台服务器.

I want to setup a CRON that runs a PHP script that in turn moves XML file (holding non-sensitive information) from one server to another.

已给我提供了正确的用户名/密码,并想使用SFTP协议.作业将每天运行.一台服务器可能是Linux,另一台服务器是Windows.两者都在不同的网络上.

I have been given the proper username/password, and want to use SFTP protocol. The jobs will run daily. There is the potential that one server is Linux and the other is Windows. Both are on different networks.

移动该文件的最佳方法是什么?

What is the best way to move that file?

推荐答案

如果两个服务器都在Linux上,则可以使用

If both servers would be on Linux you could use rsync for any kind of files (php, xml, html, binary, etc). Even if one of them will be Windows there are rsync ports to Windows.

这篇关于使用PHP将文件从一台服务器移动到另一台服务器的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆