CodeIgniter Forums
Problems with altervista - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Problems with altervista (/showthread.php?tid=63000)



Problems with altervista - mtrick - 09-15-2015

I have installed my website on Altervista but gives me problems with loading 'models'.
I don't know what is the problem. Can someone help me?

[Image: Immagine.jpg]


RE: Problems with altervista - ivantcholakov - 09-15-2015

$this->load->model('home_model');


RE: Problems with altervista - mtrick - 09-15-2015

This is my code:


Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

function index()
   {
       $this->load->model('home_model');

       $data['n'] = $this->home_model->Novita();
       $data['v'] = $this->home_model->Venduti();
       $this->load->view('primaview');
       $this->load->view('menu');
       $this->load->view('home', $data);
       $this->load->view('footer');
   }
}
?>

Also the folder "membri" that appears in the path is not part of my site but I think it's part of altervista



Code:
Message: Unable to locate the model you have specified: Home_model

Filename: /membri/****/system/core/Loader.php



RE: Problems with altervista - ivantcholakov - 09-16-2015

Debug the method CI_Loader::model directly on the production site and try to see what path is really built about loading the model. Use temporary code, something like: var_dump($path); exit;


RE: Problems with altervista - mwhitney - 09-16-2015

Make sure the model's class and filename both start with an uppercase letter: "Home_model". You can use all lowercase when calling the loader and when referencing it via $this->home_model, but the loader is going to look for Home_model.php with a class named Home_model, and some filesystems (like those used in Windows) are case-insensitive, but the filesystems on most servers are not.

If that's not the problem, make sure your APPPATH is set correctly, since APPPATH . 'models/' is where it's most likely to be looking for your model.


RE: Problems with altervista - mtrick - 09-17-2015

My APPPATH is set to  
PHP Code:
/membri/***/application
but I don't know why there is always the folder calls "membri".