0

I'm getting an error as:

Parse error: syntax error, unexpected end of file in ...\system\core\Loader.php(829) : eval()'d code on line 307..

this is code in loader.php

foreach ($this->_ci_model_paths as $mod_path)
        {
            if ( ! file_exists($mod_path.'models/'.$path.$model.'.php'))
            {
                continue;
            }

            if ($db_conn !== FALSE AND ! class_exists('CI_DB'))
            {
                if ($db_conn === TRUE)
                {
                    $db_conn = '';
                }

                $CI->load->database($db_conn, FALSE, TRUE);
            }

            if ( ! class_exists('CI_Model'))
            {
                load_class('Model', 'core');
            }

            require_once($mod_path.'models/'.$path.$model.'.php');

            $model = ucfirst($model);

            $CI->$name = new $model();

            $this->_ci_models[] = $name;
            return;
        } // this line number 307

and eval code

if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE)
        {
            echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));//this is line number 829
        }
        else
        {
            include($_ci_path); 
        }

I tried searching for this but couldn't find anything.

shA.t
  • 16,580
  • 5
  • 54
  • 111
webpic
  • 443
  • 1
  • 10
  • 23
  • this is the core loader file for codeigniter. The error has been pointed to this page but its actually in your php code. check your code especially where your model is invoked or called. – Harigovind R Apr 21 '15 at 10:11

1 Answers1

1

This will be caused by a File you have written.

It looks like you might be loading a model with a missing { or } or some syntax error. So you need to determine what models you are loading.

You can do that from the URL to see what controller/method you are calling. Check the controllers constructor to see if you are loading any models there... Check the Method and also check your autoloader.

Then check those models - the ones you have written - and look for errors. If you are using a decent editor or IDE, you should see where they are occurring.

TimBrownlaw
  • 5,457
  • 3
  • 24
  • 28