Codeigniter Command line error - PHP Fatal error: Class 'CI_Controller' not found
Solved! (partly) the issue was CodeIgniters error logging.
In application/config/config.php, I modified the following config property:
$config['log_threshold'] = 0;
This disables logging, and allows $ php index.php
to execute.
If anyone can explain why CI only shows this error on CLI PHP - might help anyone else who has this issue and needs it resolved with error logging on.
Got Fatal error CodeIgniter CI_Controller not found
Check your database config in application/config/database.php it's one of the major time consuming error message I faced with CI. Because the error message was simply misleading. So, check the DB config first.
codeigniter - fatal error class 'CI_Controller' not found after upgrade php and apache
Finally Its SOLVED!
just need change:
on CodeIgniter.php line 75
set_error_handler('_exception_handler');
to
set_exception_handler('_exception_handler');
Fatal error: Class 'CI_Controller' not found in Codeigniter.php
When configuring routes in CodeIgniter, the path does not require the index.php
part.
In this case it's going to try and look for the controller 'Index.php', the action 'rss' and pass through the parameter 'index'.
You should change your route to be:
$route['admin/refresh_rss'] = "rss/index";
Edit Here's the CodeIgniter routing manual
CodeIgniter: Class 'CI_Controller' not found
I don't think CI_Controller is loaded yet. The Exception class is handling the 404 page output using an include
.
In the old days, I used to use straight include
s to piece together a template, or do a file_get_contents()
or cURL request to my 404 page URL, but they finally did something about it. In 2.0 you can define a custom 404 page in routes.php
:
$route['404_override'] = 'controller/method/parameter';
It's still not a perfect solution, but the easiest way now is just to use the route.
Note that base_url()."controller/method/parameter"
must be a valid url, and you should make sure to set a 404 header in the controller that outputs the page too (it's not done automatically for some reason).
Codeigniter Fatal error: Class 'CI_Controller' not found in
what version of CI are you using?
because in 2.0 the controller super class is CI_Controller
and in CI version 1 the controller super class is Controller
CodeIgniter CI_Controller not found
Quite strange. I just replicated your case (with the info provided) and I encountered no problems. But make sure of a couple things:
- Your file is named MY_Log.php, and is located in
application/libraries/My_log.php
- The file extends the parent class, in this case CI_Log
You call the library in your controller as
$this->load->library('log');
$this->log->do_something();i.e, not using "My_log" but the parent library's name. In fact, you're extending it, not creating a different one, so CI wants you to call it the same as the original
Your original file has the following line correctly written (without the $ sign before CI)
$this->CI =& get_instance();
My test case with your code provided works fine on my development machine (Windows 7 WAMP php 5.3.8). I'll be waiting for more infos.
Related Topics
Unix Permissions, Read VS. Execute (PHP Context)
How to Change the Name of an Element in Dom
Why Do I Receive "This Value Should Be of Type String" When Using a Datetime Constraint on Symfony 5
How to Access the Google Spreadsheets API in PHP
How to Curry Method Calls in PHP
How to Keep Leading Zeros in PHP Integer
Simplexml: Append One Tree to Another
Issues Porting PHP/Gd Wrapper to Imagick
Unable to Scrape Content from a Website
PHP String Concatenation - "$A $B" VS $A . " " . $B - Performance
"Premature End of Data" Error with PHP
Php:Difference Between '&&' and 'And'
Alternative for $_Server['Http_Referer'] PHP Variable in Msie
Mongodb Aggregate Query Using PHP Driver