title: mysqli::real_connect(): (HY000/2002): Connection refused on Live
body: <p>I create a web site using PHP, Mysql, and Codeignater version 3. Then host it on iPage. When I upload on live I make changes in config file. </p>
  
  <pre><code>$db['default'] = array(
      'dsn'   =&gt; '',
      'hostname' =&gt; '66.96.147.118',
      'username' =&gt; 'bit_root',
      'password' =&gt; 'root',
      'database' =&gt; 'bit_shilp',
      'dbdriver' =&gt; 'mysqli',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; FALSE,
      'db_debug' =&gt; (ENVIRONMENT !== 'production'),
      'cache_on' =&gt; FALSE,
      'cachedir' =&gt; '',
      'char_set' =&gt; 'utf8',
      'dbcollat' =&gt; 'utf8_general_ci',
      'swap_pre' =&gt; '',
      'encrypt' =&gt; FALSE,
      'compress' =&gt; FALSE,
      'stricton' =&gt; FALSE,
      'failover' =&gt; array(),
      'save_queries' =&gt; TRUE
  );
  </code></pre>
  
  <p>I use codeignater version 3. On local it work great. But on live site It gives an error. </p>
  
  <p>Please see this link <a href="http://bitshilp.com/BitShilp/index.php/home" rel="nofollow">http://bitshilp.com/BitShilp/index.php/home</a></p>
  
  <p>It gives an error like this:</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Warning</p>
    
    <p>Message: mysqli::real_connect(): (HY000/2002): Connection refused</p>
    
    <p>Filename: mysqli/mysqli_driver.php</p>
    
    <p>Line Number: 161</p>
    
    <p>Backtrace:</p>
    
    <p>File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/application/controllers/Home.php
    Line: 7
    Function: __construct</p>
    
    <p>File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/index.php
    Line: 292
    Function: require_once
    A PHP Error was encountered</p>
    
    <p>Severity: Warning</p>
    
    <p>Message: Cannot modify header information - headers already sent by (output started at
    /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/system/core/Exceptions.php:272)</p>
    
    <p>Filename: core/Common.php</p>
    
    <p>Line Number: 568</p>
    
    <p>Backtrace:</p>
    
    <p>File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/application/controllers/Home.php
    Line: 7
    Function: __construct</p>
    
    <p>File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/index.php
    Line: 292
    Function: require_once</p>
  </blockquote>
  
  <p>Thanks.</p>