CI Error

in Framework, PHP, Tutorials

Weird Error: Fatal error: Class ‘CI_Controller’ not found in Codeigniter Framework

It’s a simply weird and misleading error message.  I was working on a client project which was actually based on Codeigniter  (CI) framework version 2.1.3.  Somehow, I did a typo in DB setting located at config/database.php file. But, I got a very weird error message: Fatal error: Class ‘CI_Controller’ not found in /var/www/my/……./system/core/CodeIgniter.php on line 233 as below….

CI ErrorAt a first glance, it seemed that there was a bug in CI Core class. But, it was actually a misleading message. It should have been a database connection error. And, after tracing out the error message properly with xdebug  (You must have xdebug installed in your PC to get the above error tracing), i got that there was error coming from DB drive. So, quickly checked the DB setting and fixed the typo.  But, In the mean time,  I already passed two hours for fixing. Finally, at least I saved my ass from losing two hours more. 😛

Write a Comment



  1. Hi Eftakhairul,
    Thank you for leading me to right direction and not waste my 2 hours cuz of misleading error message.
    I had similar error message and spent few minutes. I tried re-uploading the system files too but of no use. Finally I found this post and checked my DB setting where my DB config was not right. Once i fixed it.. my site is up and running.

    Thank you so much.

  2. Hey,

    This was really useful, I was about to spend time on this bug with CI controller and you save me.

    Thank you for posting this.


  3. I am getting the same error when I am checking the other pages which is coming from db that is working fine but when I am trying to login with form I am getting this error.

    any solution now?

  4. Hey!,
    I got same error. To remove that i changed my DB settings according to your advise.Now it is working fine.Then i downloaded “php_xdebug-2.3.3-5.6-vc11-x86_64.dll”. Where should i copy this file, please help???