[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Зависает curl
Serg007
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $this->browser);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIE, $this->cookies);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($ch, CURLOPT_REFERER, $this->referer);
curl_setopt($ch, CURLOPT_POST, 1);

if($this->binary) {
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
}
if($this->file_upload($this->post_data)) {
curl_setopt($ch, CURLOPT_UPLOAD, 1);
$p_data = $this->parse_post_data($this->post_data, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $p_data);
}
elseif($this->encoded_post) {
if($this->file_upload($this->post_data)) curl_setopt($ch, CURLOPT_UPLOAD, 1); else curl_setopt($ch, CURLOPT_UPLOAD, 0);
$p_data = $this->parse_post_data($this->post_data, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $p_data);
}
else {
$p_data = $this->parse_post_data($this->post_data, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $p_data);
}

if($this->headers) curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);

if($this->proxy) {
curl_setopt($ch, CURLOPT_PROXY, $this->proxy);
}
if($this->proxy_user && $this->proxy_pwd) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxy_user.':'.$this->proxy_pwd);
}

curl_setopt($ch, CURLOPT_NOPROGRESS, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$this->ans = curl_exec($ch);
curl_close($ch);
unset($ch);


Для загрузки страницы использую такую функцию. Время от времени скрипт зависает, пытается загрузить страницу и останавливается на curl_exec($ch);. В чем может быть проблема?



Спустя 45 минут, 2 секунды (13.08.2010 - 15:39) vagrand написал(а):
Поставь CURLOPT_CONNECTTIMEOUT

Спустя 1 год, 9 месяцев, 4 дня, 2 часа, 55 минут, 2 секунды (17.05.2012 - 18:34) 12 написал(а):
Скрытый текст
1
[more]1212
Скрытый текст
12121212
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.