CodeIgniter Forums
MY_Controller not found - once again - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: MY_Controller not found - once again (/showthread.php?tid=65103)



MY_Controller not found - once again - raschid - 04-29-2016

Hello,

I know this question is asked and answered a couple of times before, but I still run into this Error when uploading my files to the production server.

On my laptop (xampp), everything works just fine, but on the Linux-Server I get a blank page and this dumb error:


Quote:ERROR - 2016-04-29 18:41:28 --> Severity: Error --> Class 'Main_controller' not found /application/controllers/Ueberblick.php 4


I  read: in this Forum and still have no idea what's wrong.

My MY_Controller is prefixed with "Main_". Thats how it is written in the config file, and thats exactly what the controller-file in application/core is named: Main_controller.php

Yes, with a lowercase c.

And I have two controllers extending the class and in both files the classes extend Main_controller. I doublechecked it several times.

So, what else can cause this error? Any help is kindly appreciated!

Raschid


RE: MY_Controller not found - once again - ciadmin - 04-29-2016

If your prefix is Main_, then your base controller needs to be named Main_Controller


RE: MY_Controller not found - once again - InsiteFX - 04-29-2016

Put all your extend Controller classes in the Main_controller class.


RE: MY_Controller not found - once again - raschid - 04-29-2016

(04-29-2016, 11:28 AM)InsiteFX Wrote: Put all your extend Controller classes in the Main_controller class.

Whaddaya mean?

I use something like this

Code:
class Ueberblick extends MY_Controller{ ...}


in my controllers. Is that what you suggest?


RE: MY_Controller not found - once again - raschid - 04-29-2016

(04-29-2016, 10:52 AM)ciadmin Wrote: If your prefix is Main_, then your base controller needs to be named Main_Controller

thanks, but my controller in application/core is named Main_Controller ...


RE: MY_Controller not found - once again - ciadmin - 04-29-2016

(04-29-2016, 11:35 AM)raschid Wrote:
(04-29-2016, 10:52 AM)ciadmin Wrote: If your prefix is Main_, then your base controller needs to be named Main_Controller

thanks, but my controller in application/core is named Main_Controller ...

Sorry, I misread you:

"exactly what the controller-file in application/core is named: Main_controller.php
Yes, with a lowercase c. "

to mean that yes, you used a lowercase "c".

I presume you are referring both to the filename and to the class defined inside it.


RE: MY_Controller not found - once again - Wouter60 - 04-29-2016

(04-29-2016, 11:35 AM)raschid Wrote:
(04-29-2016, 10:52 AM)ciadmin Wrote: If your prefix is Main_, then your base controller needs to be named Main_Controller

thanks, but my controller in application/core is named Main_Controller ...

Are you sure? Earlier you wrote that your controller is named Main_controller, with controller in lowercase. In Windows, this won't cause an error, because Windows is case-insensitive regarding file names. But on Linux, the file name should be Main_Controller.