[solved] file_get_contents does not work on LSWS 4.2.1

Discussion in 'PHP' started by webhostnix, Dec 2, 2012.

  1. webhostnix

    webhostnix New Member

    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 :
    I have tried on another host ( Not Litespeed ) and the script above can work properly. Please help me

    Thanks
    Last edited by a moderator: Dec 3, 2012
  2. NiteWave

    NiteWave Administrator

    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.
  3. webhostnix

    webhostnix New Member

    Thanks NiteWae for explanation

Share This Page