title: ElFinder With CodeIgniter | Unable to connect to backend
body: <p>I'm having problems using for the first time ElFinder with CodeIgniter. I've followed the installation wiki but i'm getting the following error "Unable to connect to backend". Can someone help me? I'm lost.</p>
  
  <pre><code> Here the error:
   [enter image description here][1]
  
   Here is an example of the code that i think is the key:
  </code></pre>
  
  <blockquote>
    <p>The elfinder url is: /home/optcenter/www/codeigniter/application/libraries</p>
  </blockquote>
  
  <pre><code>the upload forlder url:
  </code></pre>
  
  <blockquote>
    <p>home/optcenter/www/codeigniter/uploads</p>
  </blockquote>
  
  <p>This is my Elfinder_lib.php file</p>
  
  <pre><code>&gt; &lt;?php if (!defined('BASEPATH')) exit('No direct script access
  &gt; allowed');
  &gt;     
  &gt;     include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elfinder/elFinderConnector.class.php';
  &gt; include_once
  &gt; dirname(__FILE__).DIRECTORY_SEPARATOR.'elfinder/elFinder.class.php';
  &gt; include_once
  &gt; dirname(__FILE__).DIRECTORY_SEPARATOR.'elfinder/elFinderVolumeDriver.class.php';
  &gt; include_once
  &gt; dirname(__FILE__).DIRECTORY_SEPARATOR.'elfinder/elFinderVolumeLocalFileSystem.class.php';
  &gt;     
  &gt;     class Elfinder_lib  {   public function __construct($opts)    {
  &gt;         $connector = new elFinderConnector(new elFinder($opts));
  &gt;         $connector-&gt;run();   } }
  </code></pre>
  
  <p>Ex_controller.php</p>
  
  <pre><code>&lt;?php function elfinder_init() {   $this-&gt;load-&gt;helper('path');   $opts = array(
      // 'debug' =&gt; true, 
      'roots' =&gt; array(
        array( 
          'driver' =&gt; 'LocalFileSystem', 
          'path'   =&gt; set_realpath('../uploads/'), 
          'URL'    =&gt; site_url('../uploads/') . '/'
          // more elFinder options here
        ) 
      )   );   $this-&gt;load-&gt;library('elfinder_lib', $opts); }
  </code></pre>
  
  <p>Part of my conector.php</p>
  
  <pre><code> *  * @param  string  $attr  attribute name (read|write|locked|hidden)
  * @param  string  $path  file path relative to volume root directory started with directory separator  * @return bool|null  **/ function access($attr, $path, $data, $volume) {     return strpos(basename($path), '.') === 0       // if file/folder begins with '.' (dot)         ? !($attr
  == 'read' || $attr == 'write')    // set read+write to false, other (locked+hidden) set to true         :  null;                                 // else elFinder decide it itself }
  
  
  // Documentation for connector options: // https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options $opts = array(    // 'debug' =&gt; true,     'roots' =&gt; array(       array(          'driver'        =&gt; 'LocalFileSystem',           // driver for accessing file system (REQUIRED)          'path'          =&gt; '../uploads/',  // path to files (REQUIRED)          'URL'           =&gt; dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)             'uploadDeny'    =&gt; array('all'),                // All Mimetypes not allowed to upload          'uploadAllow'   =&gt; array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload          'uploadOrder'   =&gt; array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only           'accessControl' =&gt; 'access'           // disable and hide dot starting files (OPTIONAL)         )   ) );
  
  // run elFinder $connector = new elFinderConnector(new elFinder($opts)); $connector-&gt;run();
  </code></pre>
  
  <p>and the jQuery function that call the div container:</p>
  
  <pre><code>$(function() {
          var elf = $('#elfinder').elfinder({
              // lang: 'ru',             // language (OPTIONAL)
              url : 'elfinder/connector.php'  // connector URL (REQUIRED)
          }).elfinder('instance');          
      });
  </code></pre>