title: PHP cURL can not connect to remote server
body: <p>It works with my localhost, works well when I put this php file on other Host but whenever I put this php file in my BlueHost server this code does not work, it returns HTTP code 0. I have contacted with BlueHost customer service they said they opened every port they dont know what is wrong. So I checked the php.ini file, there I enabled cURL dll but still not working.</p>
  
  <p>On the other hand, I have also contacted the server which I am hitting with cURL, they said its their test server so they are not restricting any IP.  </p>
  
  <pre><code>&lt;?php
  $plazaCode = isset($_GET['plazaCode']) ? $_GET['plazaCode'] : 3413921;
  $productCode = isset($_GET['productCode']) ? $_GET['productCode'] : 18044;
  $requestUrl = "http://103.243.142.55:8080/eComm/OnlineSale/currentStock?plazaCode=$plazaCode&amp;productCode=$productCode";  
  
  $content = get_data($requestUrl);
  echo $content;
  
  function get_data($url) {
      try{
          $ch = curl_init();
          if ($ch === FALSE){
              throw new Exception('failed to initialize cURL variable');}
          $timeout = 60;
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
          curl_setopt($ch, CURLOPT_PORT, 8080);
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
          curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , 0);
          $data = curl_exec($ch);
          print curl_error($ch);
          echo '&lt;br&gt;';
          echo 'input url = '.$url;
          echo '&lt;br&gt;';
          foreach(curl_getinfo($ch) as $key=&gt;$value){
              if($key=='http_code')
                  echo 'response '.$key.' = '.$value.'&lt;br/&gt;';
          }
          //var_dump(curl_getinfo($ch));
          curl_close($ch);
          return $data;
      }
      catch(Exception $e){
          trigger_error(sprintf(
              'cURL failed with error #%d: %s',
              $e-&gt;getCode(), $e-&gt;getMessage()),
              E_USER_ERROR);
      }
  }
  
  ?&gt;
  </code></pre>