I am using
Apache/2.2.16 (Debian)
PHP Version 5.3.3-7+squeeze13
and for main idea for problem see below
my problem is same as define here Extended Controller class not found – stumped!
Then I proceeded to extend the controller class with only a
constructor to keep it simple:
<?php
class MY_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
}
?>
Then in the ‘application/controllers/welcome.php’ controller I changed
the name of the “Controller” class it extends to my new extended class
“MY_Controller”
<?php
class Welcome extends MY_Controller
{
public function Welcome()
{
parent::__construct();
}
public function index()
{
$this->load->view('welcome_message');
}
}
Then I run the site and I get
Fatal error: Class ‘MY_Controller’ not found in
/application/controllers/welcome.php
on line 4
this error only showing on live server, it is working fine on localhost and also working on Apache/2.2.22 (Ubuntu) but not on Apache/2.2.16 (Debian).
i also tried change parent::__construct(); with parent::Controller(); but same error.
any solution thanks
put class MY_Controller (as MY_Controller file) in application/core folder (CI version 2.0 or higher)
With lower version, put in application/libraries