与其他服务器下载文件

时间:2013-10-15 08:54:41

标签: php nginx apache2

简单的问题。我有:

  1. VPS
  2. localhost server(简单)
  3. 我在SERVER 1(vps)上有文件:sitemap.xml我希望使用函数ex在SERVER 2中下载sitemap.xmlfile_get_contents(ip_vps/sitemap.xml)

    但是我无法下载文件或下载很长时间。怎么用GOOD配置VPS?

    PS:对不起我的英语。我试着学习。

1 个答案:

答案 0 :(得分:0)

尝试这样做

file_put_contents( 'server1.xml',的file_get_contents( 'http://othersiteURL.com/sitemap.xml'));

使用simplexml_load_file( 'server1.xml');