gun2rin
Новичок
Не работают функции Curl
На одном сервере работают, а на другом нифига.
На обоих серверах стоит libcurl/7.10.5 OpenSSL/0.9.7a
Вот тестовый скрипт:
В одном случае на выходе:
Array ( => [url]http://www.zend.com [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0.001 [connect_time] => 0.001 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0 )
errno:55
error:Failed sending HTTP request
А в другом (работающем)
Array ( => [url]http://www.zend.com [content_type] => text/html [http_code] => 200 [header_size] => 634 [request_size] => 122 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.895 [namelookup_time] => 0.512 [connect_time] => 0.683 [pretransfer_time] => 0.684 [size_upload] => 0 [size_download] => 37917 [speed_download] => 20008.970976253 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 1.196 [redirect_time] => 0 )
errno:0
error:
P.S. В данный момент названиваю хостеру. Ведь все работало же!
На одном сервере работают, а на другом нифига.
На обоих серверах стоит libcurl/7.10.5 OpenSSL/0.9.7a
Вот тестовый скрипт:
PHP:
<?
$url = "http://www.zend.com";;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$result = curl_exec($ch);
echo $result;
print_r(curl_getinfo($ch));
echo '<br>errno:'.curl_errno($ch);
echo '<br>error:'.curl_error($ch);
echo '<br>'.$buffer;
echo '<br>ver:'.curl_version ();
curl_close($ch);
?>
Array ( => [url]http://www.zend.com [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0.001 [connect_time] => 0.001 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0 )
errno:55
error:Failed sending HTTP request
А в другом (работающем)
Array ( => [url]http://www.zend.com [content_type] => text/html [http_code] => 200 [header_size] => 634 [request_size] => 122 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.895 [namelookup_time] => 0.512 [connect_time] => 0.683 [pretransfer_time] => 0.684 [size_upload] => 0 [size_download] => 37917 [speed_download] => 20008.970976253 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 1.196 [redirect_time] => 0 )
errno:0
error:
P.S. В данный момент названиваю хостеру. Ведь все работало же!