0
我有以下PHP腳本,可以在99%的時間內完美工作。但它不會從這臺我認爲運行Varnish Cache的服務器下載映像。cURL無法從運行Varnish Cache的服務器上下載映像文件
<?php
$imglink = 'http://www.dirtrider.com/wp-content/uploads/2014/10/WD-10_1_14-001.jpg';
$ch = curl_init($imglink);
$fp = fopen('/home/path/www/tmp/test.jpg', "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_exec($ch);
fclose($fp);