LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   PHP (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=19)
-   -   [solved] file_get_contents does not work on LSWS 4.2.1 (http://www.litespeedtech.com/support/forum/showthread.php?t=6414)

webhostnix 12-01-2012 06:12 PM

[solved] file_get_contents does not work on LSWS 4.2.1
 
Hi,

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

Here is the code :
PHP Code:

<?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 :
Quote:

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

NiteWave 12-02-2012 08:28 AM

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.

webhostnix 12-02-2012 08:30 AM

Thanks NiteWae for explanation


All times are GMT -7. The time now is 06:37 PM.