title: Issue with autoloading database and session libraries - codeigniter
body: <p>Right,</p>
  
  <p>I was working on building a login system with codeigniter. It worked fine up until it started throwing up errors when trying to view the site. So I spent a few hours on Google trying to find out what could be wrong. I've managed to narrow the problem down to autoloading the libraries</p>
  
  <p>The first error is:</p>
  
  <pre><code>Unable to connect to your database server using the provided settings.
  
  Filename: core/Loader.php
  
  Line Number: 346
  </code></pre>
  
  <p>This corrects itself if I remove 'database' from the libraries array in autoload.php</p>
  
  <pre><code>$autoload['libraries'] = array();
  </code></pre>
  
  <p>The second error comes with autoloading sessions. The error is as follows:</p>
  
  <pre><code>The Encrypt library requires the Mcrypt extension.
  </code></pre>
  
  <p>Now, I'm not really sure about the sessions, but I know my database settings are fine.</p>
  
  <p>I can, without any issue, pass data into my database when loading it manually in the model like so:</p>
  
  <pre><code>$this-&gt;load-&gt;database();
  </code></pre>
  
  <p>So my question is, why is autoloading all of a sudden throwing these errors? Does any one have any suggestions?</p>
  
  <p>Thanks in advance</p>