title: Can't check Mime Type in CodeIgniter
body: <p>I have written a CodeIgniter class controller to check the mimetype of a file. Here's my script</p>
  
  <pre><code>&lt;?php
  class test_file extends CI_Controller{
      public function __construct() {
          parent::__construct();
          @session_start();
          $this-&gt;load-&gt;library('encrypt');
          $this-&gt;load-&gt;helper('file');
      }
  
      function index()
      {
          $path="./post_files/Catherine_Part1.wmv";
          echo "&lt;a href='".base_url().$path."'&gt;Show&lt;/a&gt;";
          if(function_exists('mime_content_type') &amp;&amp;$mode==0)
              echo mime_content_type($path);
          else if(function_exists('finfo_open')&amp;&amp;$mode==0)
          { 
              $finfo = finfo_open(FILEINFO_MIME);
              $mimetype = finfo_file($finfo, $path);
              echo $mimetype;
          }
          else
              echo "no functions working";
          echo get_mime_by_extension($path);
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>The issue is that it's always printing <code>no functions working</code>.</p>
  
  <p>That means both of the <code>mime_content_type()</code> and <code>finfo_open()</code> functions exist. But how can that happen?</p>
  
  <p>Also <code>echo get_mime_by_extension($path);</code> doesn't echo anything.</p>
  
  <p>However the path file is totaly correct. If I click on the show a href anchor, then it plays the file in the browser.</p>