title: Codeigniter: How to setup connection to a SQL server (2008)
body: <p>I've spent many days on this task, and I can't see the end until now. In the past day I managed to install sqlsrv driver on my PHP environment successfully but now when I try to connect I get this message:</p>
  
  <blockquote>
    <p>Unable to connect to your database server using the provided settings.</p>
  </blockquote>
  
  <p>My settings in <code>application/config/database.php</code> are so defined:</p>
  
  <pre><code>$db['dbname']['hostname'] = "ENJ01\SQLEXPRESS";
  $db['dbname']['username'] = "user";
  $db['dbname']['password'] = "password";
  $db['dbname']['database'] = "dbname";
  $db['dbname']['dbdriver'] = "sqlsrv";
  $db['dbname']['dbprefix'] = "";
  $db['dbname']['pconnect'] = TRUE;
  $db['dbname']['db_debug'] = TRUE;
  $db['dbname']['cache_on'] = FALSE;
  $db['dbname']['cachedir'] = "";
  $db['dbname']['char_set'] = "utf8";
  $db['dbname']['dbcollat'] = "utf8_general_ci";
  $db['dbname']['swap_pre'] = '';
  $db['dbname']['autoinit'] = TRUE;
  $db['dbname']['stricton'] = FALSE;
  </code></pre>
  
  <p>something wrong?</p>
  
  <p>Here my environment configuration:</p>
  
  <ul>
  <li>wampserver 2.4 x86</li>
  <li>PHP 5.4.16</li>
  <li>sqlsrv driver -> php_sqlsrv_54_ts.dll</li>
  <li>Codeigniter 2.1.4</li>
  </ul>