Welcome Guest, Not a member yet? Register   Sign In
Unable to Find model?
#1

[eluser]amw_drizz[/eluser]
Okay, here is the issue I am running into. On my windows xp development machine running Apache 2.2 with PHP 5.2.6 everything works fine. But when I upload it to my live site which is hosted with vlexo.com runing linux with apache 1.3 and suPHP 5.2.6



When uploaded, I loose the models, all the files are there. But the site doesn't work. But the same code that isn't altered much except for changing the site root / base url to the that of my live site.

But on my live site, it no longer loads, it just says unable to load model.
#2

[eluser]TheFuzzy0ne[/eluser]
Please paste the code for one of the models that doesn't work.
#3

[eluser]amw_drizz[/eluser]
Okay this is my ThemeHandler.php Model as the name implies is what it does
Code:
<?php
/*------------------------------------------
| Author :: Jonathan Nedobity
| Version :: 1.0
| Date Created :: 2/25/2009
| Date Modified :: 3/12/2009
| About ::
|     This file handles all skining of website
|    contents, it takes all input from other
|    files and creats the final output.
|    this file should be called last!
------------------------------------------*/
class ThemeHandler extends Model{
    /*-------------------------------
    | The function below will initalize the class
    | along with setting variables for future use
    |--------------------------------*/
    function Themehandler(){
        parent::Model();
        /* the header variables will eventually become dynamic
        |  to a database instead of being hard coded */
        $header['title'] = "CrystalX"; // Title of the website
        $header['discription'] = NULL; // Descirption of the website
        $header['keywords'] = NULL; // keywords for search engines
        $header['static'] = "http://test.jonweb.vlexo.net/static/themes/crystalx"; // Static path for js and images for the theme
        $header['static_path'] = "http://test.jonweb.vlexo.net/static/";
        $this->head = $header; // we now assing it so all functions can use it

    }
    /*--------------------------------
    |    this is the bread of this file,
    |    it will take inputs, for fomating
    |    and display it on the clients
    |    web browser.
    |---------
    |    $data is the common data for use in a single
    |    non-repeating page
    |    $use_empty will toggle if TRUE to use the
    |    repeating template for database arrays, or arrays
    |    that are multi-demensional
    |    $od is to be used if $use_empty is true, as it passes
    |    such of an array to the parser
    |-----------------------------------*/
    function loadOutput($data,$use_empty = FALSE,$od = NULL,$codeview = FALSE){ // For a single page, $use_empty and $od are optional
        if($use_empty == TRUE){
            $data2['empty'] = $this->parser->parse('themes/crystalx/dynamic/dynamic_content',$od,TRUE);
            $this->load->view('themes/crystalx/static/header',$this->head);
            $this->load->view('themes/crystalx/static/main_menu');
            $this->load->view('themes/crystalx/static/empty',$data2);
            $this->load->view('themes/crystalx/static/empty',$this->CreateSidebar());
            $this->load->view('themes/crystalx/static/footer.php');
        }
        elseif($codeview == FALSE){
            $this->load->view('themes/crystalx/static/header',$this->head);
            $this->load->view('themes/crystalx/static/main_menu');
            $this->load->view('themes/crystalx/static/static_content',$data);        
            $this->load->view('themes/crystalx/static/empty',$this->CreateSidebar());
            $this->load->view('themes/crystalx/static/footer.php');            
        }
        else{
            $this->load->view('themes/crystalx/static/header',$this->head);
            $this->load->view('themes/crystalx/static/main_menu');
            $this->load->view('themes/crystalx/static/code_content',$data);        
            $this->load->view('themes/crystalx/static/empty',$this->CreateSidebar());
            $this->load->view('themes/crystalx/static/footer.php');            
        }
    }
.... more code
}
?>
Cut off, the full file is too long but you get the geist
#4

[eluser]TheFuzzy0ne[/eluser]
What's the exact error message you're getting? Is it "Unable to locate the model you have specified: <Model Name>"?

If so, the only three things I know of that could cause the problem are:
Invalid application path in config.php
Incorrect file permissions.
The file really doesn't exist.

Try loading the model file with a simple include(), see if it works then.
Code:
include(APPPATH . 'models/MODEL_NAME.php');
#5

[eluser]TheFuzzy0ne[/eluser]
My final verdict is that your file names are not lowercase like they're supposed to be. Windows doesn't care about filename case, Linux filenames are case sensitive.
#6

[eluser]amw_drizz[/eluser]
Now I got
Fatal error: Class 'Model' not found in /home/jonwebv/public_html/test/system/application/models/ThemeHandler.php on line 13
#7

[eluser]amw_drizz[/eluser]
oops, that would explain some of it, themehandler.php is actually ThemeHandler.php
#8

[eluser]TheFuzzy0ne[/eluser]
So you've solved the problem?
#9

[eluser]amw_drizz[/eluser]
soon as I changed all calls to lower case it now works.
#10

[eluser]Colin Williams[/eluser]
Best to stick to the naming conventions spelled out in the User Guide. Glad you got it worked out




Theme © iAndrew 2016 - Forum software by © MyBB