CodeIgniter Forums
Get_instance Does not work in Hosting - 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: Get_instance Does not work in Hosting (/showthread.php?tid=69298)



Get_instance Does not work in Hosting - buzz4rd - 11-01-2017

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');
}



RE: Get_instance Does not work in Hosting - dave friend - 11-01-2017

Why do you think the problem is related to the code you show?


RE: Get_instance Does not work in Hosting - buzz4rd - 11-01-2017

(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.


RE: Get_instance Does not work in Hosting - dave friend - 11-01-2017

Why do you think that the page not showing is related to loading the model?


RE: Get_instance Does not work in Hosting - Paradinight - 11-02-2017

(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.


RE: Get_instance Does not work in Hosting - buzz4rd - 11-02-2017

(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.


RE: Get_instance Does not work in Hosting - InsiteFX - 11-02-2017

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 ( ?> ).