解决方案 »

  1.   

    if($s = file_get_contents(url)) {
      $im = imagecreatefromstring($s);
      ....
    }读取远程数据偶有失败是很正常的
      

  2.   

    Warning: imagecreatefrompng(): Cannot read image data
    警告:imagecreatefrompng():无法读取的图像数据
      

  3.   

    imagecreatefromstring这方式也试过,情况一样。偶有失败是很正常。但这情况能持续重现,url通过浏览器的话,全部都能读取。另外就是另外一台服务器正常。不知道服务器本身iptabale设置是否对其影响。