Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member function on a non-object -- ** IMPORTANT SOLUTION
#1

[eluser]ACEFX[/eluser]
Hi

I thought i should post this as it will help alot, i have an application built on CI running perfectly on my Ubuntu machine @ home but when uploaded to my server it fails and gives the error:

Fatal error: Call to a member function on a non-object...

I tried to solve it and kept getting thesame error, finally i realized that the default version of PHP is 4 so using :
Code:
function __construct(){
        parent::Controller();
}

makes it fail for loading default model.
So incase you are still on PHP4 you might want to use

Code:
function Classname(){
        parent::Controller();
}

so you can load any model at runtime.

Thanks
#2

[eluser]n0xie[/eluser]
Seems pretty obvious to me that if you are running PHP4 you should use PHP4 constructors...




Theme © iAndrew 2016 - Forum software by © MyBB