[solved] file_get_contents does not work on LSWS 4.2.1

#1
Hi,

file_get_contents does not work on LSWS 4.2.1 ( Blank page/no result ).

Here is the code :
PHP:
<?php
$contents = file_get_contents('http://www.bing.com/search?q=litespeed&qs=n&form=QBLH&pq=ngodi&sc=0-0&sp=-1&sk=&format=rss');
echo $contents;
?>
here is header check :
HTTP/1.0 200 OK =>
Date => Sun, 02 Dec 2012 01:51:21 GMT
Server => LiteSpeed
Connection => close
X-Powered-By => PHP/5.3.19
Content-Type => text/html
Content-Length => 0
I have tried on another host ( Not Litespeed ) and the script above can work properly. Please help me

Thanks
 
Last edited by a moderator:

NiteWave

Administrator
#2
this issue has become clear:
while file_get_contents not working,
run shell command:
Code:
#curl -I www.bing.com
curl: (7) Failed to connect to 2001:4870:a14a:100::cebe:4fd2: Network is unreachable
#host www.bing.com
www.bing.com is an alias for a134.dsw3.akamai.net.
a134.dsw3.akamai.net has address 64.30.215.190
a134.dsw3.akamai.net has IPv6 address 2001:4870:a14a:100::cebe:4fd9
a134.dsw3.akamai.net has IPv6 address 2001:4870:a14a:100::cebe:4fd2
#curl -I -H "host:www.bing.com" 64.30.215.190
curl: (7) couldn't connect to host
so it's clear that accessing to www.bing.com too frequently(in php script) has caused the server's IP banned by bing. Usually IP banned for some time temporarily. after some time, can access bing again.
 
Top