Пытаюсь попасть на сайт скриптом, но в ответ Connection:close и Internal server error.
function curl($url){
$headers = array(
'GET ' . $url . ' HTTP/1.0',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0',
'Accept: text/html,
application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding: gzip, deflate',
'Connection: keep-alive'
);
$ch = curl_init();
curl_setopt ($ch , CURLOPT_URL , $url );
curl_setopt ($ch , CURLOPT_USERAGENT , "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0");
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_REFERER, '
https://www.google.com.ua');
curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt ($ch , CURLOPT_RETURNTRANSFER , 1 );
$file = curl_exec($ch);
return $file;
}
Сам запрос в Фиддер 4
GET / HTTP/1.1
Host: it-weekly.ru
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: BITRIX_SM_GUEST_ID=5887196; BITRIX_SM_LAST_VISIT=13.02.2016+16%3A16%3A25; BITRIX_SM_LAST_ADV=5_Y; __utma=24257250.1849781716.1455134909.1455351502.1 455369036.6; __utmz=24257250.1455351502.5.5.utmcsr=google|utmcc n=(organic)|utmcmd=organic|utmctr=(not%20provided) ; _ym_uid=1455134909594827418; BX_USER_ID=7f7ba1be030d47aea8577d104e129a4a; resolution=800; __utmc=24257250; PHPSESSID=c72285cf06fcd6764af901ebe891b8ed
Connection: keep-alive
Декодированая версия
HTTP/1.1 200 OK
Server: nginx/0.8.53
Date: Sat, 13 Feb 2016 20:04:57 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/5.3.18
P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"
X-Powered-CMS: Bitrix Site Manager (19b839d1031a99892d4b0429297bad16)
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Set-Cookie: PHPSESSID=24fa65693270aaec2831489b3897e176; path=/; domain=it-weekly.ru; HttpOnly
Set-Cookie: BITRIX_SM_GUEST_ID=5887196; expires=Tue, 07-Feb-2017 20:04:53 GMT; path=/; domain=it-weekly.ru
Set-Cookie: BITRIX_SM_LAST_VISIT=13.02.2016+23%3A04%3A53; expires=Tue, 07-Feb-2017 20:04:53 GMT; path=/; domain=it-weekly.ru
Content-Length: 51223