Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.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 - Fatal编程技术网

Php 加载数据库时的Codeigniter空白页

Php 加载数据库时的Codeigniter空白页,php,codeigniter,Php,Codeigniter,所以在搜索stackoverflow之后,决定写这个问题 这次我在做戈达迪的主持计划。 上传了一个干净的软件包,欢迎信息显示了它应该显示的内容。 我用url配置了config.php,用正确的连接数据配置了database.php。 到目前为止,一切都正常运转。 因此,在加载数据库之后,如果我刷新页面,就可以查看是否一切正常,并显示“死机的空白屏幕” <?php if ( ! defined('BASEPATH')) exit('No direct script access allowe

所以在搜索stackoverflow之后,决定写这个问题

这次我在做戈达迪的主持计划。 上传了一个干净的软件包,欢迎信息显示了它应该显示的内容。 我用url配置了config.php,用正确的连接数据配置了database.php。 到目前为止,一切都正常运转。 因此,在加载数据库之后,如果我刷新页面,就可以查看是否一切正常,并显示“死机的空白屏幕”

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     *      http://example.com/index.php/welcome
     *  - or -  
     *      http://example.com/index.php/welcome/index
     *  - or -
     * Since this controller is set as the default controller in 
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */
    public function index()
    {
        $this->load->database();
        $this->load->view('welcome_message');
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
在日志文件中,返回以下行

DEBUG - 2015-11-19 20:57:31 --> Config Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Hooks Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Utf8 Class Initialized
DEBUG - 2015-11-19 20:57:31 --> UTF-8 Support Enabled
DEBUG - 2015-11-19 20:57:31 --> URI Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Router Class Initialized
DEBUG - 2015-11-19 20:57:31 --> No URI present. Default controller set.
DEBUG - 2015-11-19 20:57:31 --> Output Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Security Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Input Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Global POST and COOKIE data sanitized
DEBUG - 2015-11-19 20:57:31 --> Language Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Loader Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Helper loaded: url_helper
DEBUG - 2015-11-19 20:57:31 --> Helper loaded: html_helper
DEBUG - 2015-11-19 20:57:31 --> Helper loaded: cms_helper
DEBUG - 2015-11-19 20:57:31 --> Helper loaded: drops_helper
DEBUG - 2015-11-19 20:57:31 --> Controller Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Model Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Model Class Initialized
DEBUG - 2015-11-19 20:57:31 --> Helper loaded: form_helper
DEBUG - 2015-11-19 20:57:31 --> Database Driver Class Initialized
我需要部署一个在其他服务器上生成的Web,当我在GoDead上传时出现空白页面,这就是为什么我上传一个干净的CODENIGTER包的原因。 有人能帮我吗? 提前谢谢


编辑 忘记在index.php上编写错误报告

define('ENVIRONMENT', 'development');

if (defined('ENVIRONMENT'))
{
    switch (ENVIRONMENT)
    {
        case 'development':
            ini_set('display_errors',1);
            error_reporting(E_ALL);
        break;

        case 'testing':
        case 'production':
            error_reporting(0);
        break;

        default:
            exit('The application environment is not set correctly.');
    }
}

在application/config/autoload.php中加载数据库库,如下所示:

$autoload['libraries'] = array('database');
从文件中删除以下行:

$this->load->database();

在application/config/autoload.php中加载数据库库,如下所示:

$autoload['libraries'] = array('database');
从文件中删除以下行:

$this->load->database();

添加
ini\u集('display\u errors',1);错误报告(E_全部)到页面顶部查看PHP错误。这不会解决问题,但会让你更好地理解。如果您只收到有关已发送的标题的错误,请删除这些行。很抱歉没有指定,但它位于index.php中。感谢您的回答添加
ini\u集('display\u errors',1);错误报告(E_全部)到页面顶部查看PHP错误。这不会解决问题,但会让你更好地理解。如果您只收到有关已发送的标题的错误,请删除这些行。很抱歉没有指定,但它位于index.php中。谢谢你的回答,我已经试过了,但是没有用。但是$this->load->database()也应该可以工作。我不认为这是一个解决办法。另外,行$CI=new$class()中存在问题;对不起,我已经试过了,但没用。但是$this->load->database()也应该可以工作。我不认为这是一个解决办法。另外,行$CI=new$class()中存在问题;很抱歉