file_get_contents() or curl way - nothing works in internet server , though those work in localhost
===

Question in the heading of this post is there in this site so many times. But I have got a new problem probably.

    <?php
    //$mob_num=$_POST['mob_num'];
    
    phpinfo();
    $mob_num='0111111111';
    
    $url='http://site:8080/stock/wit.do?msisdn='.$mob_num.'&keyword=bdl';
    
    
    
    //echo(file_get_contents($url));
    
    
    if (!function_exists('curl_init')){ 
            die('CURL is not installed!');
        }
    
    
    /*
    $ch = curl_init();
    
        curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);       
    
    
    $data = curl_exec($ch);
    	
    	echo ("data = ".$data);
        curl_close($ch);
    
    */
    $rCURL = curl_init();
    curl_setopt($rCURL, CURLOPT_URL, $url);
    curl_setopt($rCURL, CURLOPT_HEADER, 0);
    curl_setopt($rCURL, CURLOPT_RETURNTRANSFER, 1);
    
    
    $aData = curl_exec($rCURL);
    
    echo ("data = ".$aData);
    curl_close($rCURL);
    
    
        
    
    
    /*
    $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $output = curl_exec($ch);
        curl_close($ch);
        echo( "output = ". $output);
    
    */
    
    ?>	

I used `file_get_contents()` which is commented in the code and then used curl in two different ways (one is commented in the code).

All the three options work in localhost but no effective results in internet server.

For the `file_get_contents()`, the message says - failed to open stream: Connection refused .

For the two ways of curl, the result is blank.

`allow_url_fopen` is on, curl is enabled in the internet server.

What to do?