title: Connecting to SQL Server via CodeIgniter
body: <p>I'm trying to setup a Windows dev environment: <code>Windows 8.1 with IIS 8.5 running SQL Server 2008RC2 and PHP 5.3.24</code></p>
  
  <p>CodeIgniter 2.1.4</p>
  
  <p>I can connect to the database just fine via PDO in a normal PHP script.  But when I try to connect via CodeIgniter I get this error:</p>
  
  <pre><code>"Unable to connect to your database server using the provided settings.
  Filename: C\inetpub\wwwroot\ci\system\database\DB_Driver.php
  Line number 124"
  </code></pre>
  
  <p>If I open PHP Manager in the IIS interface I can see that the two required drivers are enabled:</p>
  
  <pre><code>php_sqlsrv_53_ts.dll
  php_pdo_sqlsrv_53_ts.dll
  </code></pre>
  
  <p>Both of those show up in my ini file.</p>
  
  <p>In my CodeIgniter database config file I have the driver set to: sqlsrv (if I use mssql I get a blank screen).</p>
  
  <p>I have the <code>/system/database/drivers/sqlsrv</code> drivers in my CI install.</p>
  
  <p>The only thing that is odd is in <code>phpinfo()</code> under Configure Command it shows <code>--without-mssql</code> and <code>--without-pdo-mssql</code> but I know it's working outside of CI.</p>
  
  <p><code>phpinfo()</code> also shows the ini file path at <code>C:\WINDOWS</code> but it also shows the loaded ini path as <code>C:\Program Files (x86)\PHP\v5.3\php.ini</code></p>
  
  <p>I tried moving it but no luck.</p>
  
  <p>My /application/config/database config file:</p>
  
  <pre><code>$db['default']['hostname'] = 'localhost';
  $db['default']['username'] = 'localsql';
  $db['default']['password'] = 'password';
  $db['default']['database'] = 'elements';
  $db['default']['dbdriver'] = 'sqlsrv';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  </code></pre>
  
  <p>Am I missing anything specific?</p>