我正在將數據從一臺服務器遷移到另一臺服務器,而我正在使用curl來做到這一點,到目前爲止,我已經成功,但有一些大型實體沒有遷移! 我試過序列化,但即使這是行不通的,沒有錯誤頁面來!該PHP已經配置到最高的所有設置,如何通過cURL發送大量數據?
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, $url);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
$result = curl_exec ($ch);
echo $result;
curl_close($ch);
我用這個既:
$stringPost = serialize($postDataFinalArray);
$postdata = 'string='.$stringPost;`
和
$postdata = http_build_query($postDataFinalArray);
請幫助!
數組大小爲400540,COUNT_RECURSIVE。
什麼是你的post_max_size設置? –
它設置爲:max_input_vars = 1000000 post_max_size = 8M – sphinx