0
我有以下代碼超時,當我嘗試從服務器文件下載了
<?php
$ch = curl_init();
$source=array("landshop_formdata.sql","landshop_clientdata.sql","landshop_blogs.sql","landshop_counter.sql","landshop_hitems.sql");
$sourcepath = "http://www.landshoppe.com/";
$root = "C:\Program Files\EasyPHP-5.3.8.1\www\Landshoppe/Downloaded Dbs/";
foreach($source as $bkup){
$source=$sourcepath.$bkup;
curl_setopt($ch, CURLOPT_URL, $source);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
$destination = $root.$bkup;
$data = file_get_contents($source);
$file = fopen($destination, "w+");
fputs($file, $data);
fclose($file);
}
?>
應該是什麼問題下載一些文件?
謝謝,弗雷德。將嘗試一下。 –
再次感謝Fred。我添加了set_time_limit(0)行,並且像魅力一樣工作! –
不客氣! :) –