CodeIgniter Forums

Full Version: Get_instance Does not work in Hosting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm using CI 3.1.0. I have made a Library. I used get_instance method in Library. It's Working fine in my local pc (xampp) But I'm getting blank page in My Hosting server. I can't figure it out.   Confused  Can anyone Help me, please?

Code:
   function __construct()
   {

       $this->CI =& get_instance();

       $this->CI->load->model('Soft_model');
}
Why do you think the problem is related to the code you show?
(11-01-2017, 09:36 PM)dave friend Wrote: [ -> ]Why do you think the problem is related to the code you show?

I'm not sure. Actually, I want to make Myself clear regarding the problem.
Why do you think that the page not showing is related to loading the model?
(11-01-2017, 08:51 PM)buzz4rd Wrote: [ -> ]Hi, I'm using CI 3.1.0. I have made a Library. I used get_instance method in Library. It's Working fine in my local pc (xampp) But I'm getting blank page in My Hosting server. I can't figure it out.   Confused  Can anyone Help me, please?

Code:
   function __construct()
   {

       $this->CI =& get_instance();

       $this->CI->load->model('Soft_model');
}

Check the error_log.
(11-01-2017, 11:59 PM)dave friend Wrote: [ -> ]Why do you think that the page not showing is related to loading the model?
Because Without the Model it Works Fine. And the model class is fine.
1) Make sure that your editor is not saving your code with the BOM.
2) Make sure there is no white space, newlines at the top and bottom of the file
3) Make sure you do not include the PHP closing tag ( ?> ).