Skip to content
Advertisement

Codeigniter 3 – A PHP Error was encountered, Severity: Notice, Message: Undefined property: Home::$home

I’m about to launch a website which I built with codeigniter3. I’ve made configuration changes such as base_url, database, etc. But it shows me an error like this :

JavaScript

JavaScript

So, here is my controller :

JavaScript

Here is my Home_model.php :

JavaScript

And here is in my core folder, because i made a custom configuration like this :

JavaScript

If I’m running the program in my localhost, it’s totally fine and works. Why do I get this error on a production server?

Advertisement

Answer

From the error message you received, the important part is

Message: Call to a member function select() on null

which means your model was not loaded!

as your code works on your localhost environment, but not on the production server, most likely the error is caused by applying wrong Naming Conventions:

  1. File names must be capitalized. For example: Myclass.php Class
  2. declarations must be capitalized. For example: class Myclass Class
  3. names and file names must match.
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement