Codeigniter,空白页,没有错误

标签 codeigniter controller

<分区>

public function newreg()
    {
        $username = $this->input->post('username');
        $password = $this->input->post('password');

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

        $data['list']=$this->register_model->add($username, $password);

        $this->load->view('register_display', $data);
    }

这是名为 register.php 的 Controller 的一部分 调用此函数后,我在屏幕上看到的只是空白。

这个函数是一个工作 Controller 的精确副本。仅更改文件名(模型、 View )

我不知道问题出在哪里。

最佳答案

您可以通过启用 CI 日志 轻松检查整个环境中发生的情况,

转到 config/config.php 并编辑它:

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
|   0 = Disables logging, Error logging TURNED OFF
|   1 = Error Messages (including PHP errors)
|   2 = Debug Messages
|   3 = Informational Messages
|   4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/


  $config['log_threshold'] = 0; //put this to 4

然后,如果您的/application 文件夹中还没有 /logs 文件夹,请创建它并向其中添加 775 chmod(仅限日志文件夹)。

更新: 您还必须 chown apache:apache logs 以便 apache 能够在该文件夹中写入。

通过浏览器运行您的应用程序并检查您的/logs 文件夹中的log.php 文件,它将包含所有应用程序错误 .

关于Codeigniter,空白页,没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14165283/

相关文章:

php - 我在数据表中添加分页,但表记录重复

grails - Grails:为什么如果使用Ajax,则仅在刷新后呈现Flash消息?

php - 如何将变量传递给 Laravel Controller 中的 View

mysql - Codeigniter 404 页面未找到

php - mysql中如何根据where进行计数? PHP

php - Twilio 异常在 codeigniter 中给出错误

php - CodeIgniter ionic 授权 : How is is_admin() working?

ruby-on-rails - RSPEC 错误 : expected: [2015-05-01 19:56:25 -0700] got: nil (compared using ==) Ruby on Rails

controller - Odoo 从 Web Controller 生成警告(弹出)

java - 避免在 Spring 中创建 session