Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在第一个codeigniter应用程序上获取错误_Php_Codeigniter_Controller - Fatal编程技术网

Php 在第一个codeigniter应用程序上获取错误

Php 在第一个codeigniter应用程序上获取错误,php,codeigniter,controller,Php,Codeigniter,Controller,我是codeigniter的新手,我正在尝试我的第一个应用程序 但我得到了以下错误: Fatal error: Class 'Controller' not found in /var/www/CodeIgniter/application/controllers/helloworld.php on line 2 应该这样做 Class Mycontroller Extends CI_Controller { function __construct(){ parent

我是codeigniter的新手,我正在尝试我的第一个应用程序

但我得到了以下错误:

Fatal error: Class 'Controller' not found in /var/www/CodeIgniter/application/controllers/helloworld.php on line 2

应该这样做

Class Mycontroller Extends CI_Controller
{
    function __construct(){
        parent::__construct();
    }

    //other functions
}

Class Mymodel Extends CI_Model
{
    function __construct(){
        parent::__construct();
    }

    //other functions
}

我认为您可能正在使用codeigniter 2,所以请使用CI_控制器而不是控制器。现在,在第2行的/var/www/codeigniter/application/models/helloworld_Model.php中,它在替换CI_u控制器后抛出此错误。在中未找到致命错误:类“Model”/第2行的var/www/CodeIgniter/application/models/helloworld_model.php使用CI_model非model
class Mycontroller扩展CI_控制器
not
class Mycontroller扩展CI_控制器