【问题标题】:Codeigniter blank page - Severity: Compile ErrorCodeigniter 空白页 - 严重性:编译错误
【发布时间】:2017-09-29 11:05:02
【问题描述】:

我有在 justhost 中运行良好的 codeigniter 应用程序。我正在尝试将其转移到 bigrock 主机。但是在新主机中它不起作用我只能看到带有 500 错误的空白页面,cpanel 中没有错误日志。在stackoverflow中遵循了许多解决方案但无法修复(最初我认为它的.htaccess问题),现在我尝试为开发定义环境变量,我可以看到如下所示的php错误

遇到了 PHP 错误

严重性:编译错误

消息:无法在写入上下文中使用方法返回值

文件名:models/Home_model.php

行号:77

回溯:

家庭模型屏幕截图

家庭模式的登录功能:

public function login($data) { 


    if(filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {
        $res = $data['email'];
    }
    else {
        $settings        = get_setting();
        $pre = $settings->id_prefix;

        $res =  trim($data['email'],$pre);
    }
    $this->db->select('*');
    $this->db->from('users');

            $this->db->join('profiles', 'profiles.email = users.email','left');
            $this->db->where('user_status','1');
            $this->db->where('users.email', $res);
            $this->db->or_where('matrimony_id',$res);
        $chk_qry = $this->db->get();
        //$chk_qry = $query->row();
        //echo $this->db->last_query();die;



    if ($chk_qry->num_rows() == 1) {
      $pass = $this->encrypt->decode($chk_qry->row()->password);

      if($data['password'] == $pass) {
        $this->db->where('user_id', $chk_qry->row()->user_id); 
        $usr_qry = $this->db->get('profiles');

        if(!empty($usr_qry->result())) {
          if($usr_qry->result()[0]->profile_status != 2) {
            if($usr_qry->result()[0]->profile_status != 4) {
              if($usr_qry->result()[0]->profile_approval == 1) {
                $status = 1;
                $this->session->set_userdata('logged_in',$usr_qry->result()[0]);
                $data1['date_time'] = date('Y-m-d H:i:s', time());
                //$data1['user_id']=$usr_qry->result()[0]->user_id;
                $data1['matrimony_id']=$usr_qry->result()[0]->matrimony_id;

                $query = $this->db->where('matrimony_id',$data1['matrimony_id']);
                $query = $this->db->get('active_members');
                if ($query->num_rows() > 0){
                 $this->db->where('matrimony_id',$data1['matrimony_id']);
                 $this->db->update('active_members',$data1); 
               } else {                   
                $this->db->insert('active_members', $data1);
              }
                        } else { $status = 2; } // Profile Not Approved
                      } else { $status = 7; } // Profile Deactivated
                    } else { $status = 5; } // Profile Deleted or Banned
                } else { $status = 6; } // No Accounts Found
            } else {    $status = 3; } // Ivalid Password 
        } else {        $status = 4; } // Email not exist
        return $status;
      }

我想知道这个相同的脚本如何在 justhost 中正常工作。

【问题讨论】:

  • 请将该屏幕截图中的代码添加到帖子中。
  • OP 添加了相同的代码@Sand
  • 尝试从if(!empty($usr_qry->result())) {中删除空白
  • 感谢您的快速回复。将 php 版本从 5.4 更新到 5.6 并且可以正常工作

标签: php .htaccess codeigniter


【解决方案1】:

问题解决了!!!傻我,

将 php 版本从 5.4 更新到 5.6

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 2013-03-11
    • 1970-01-01
    • 2012-03-24
    • 2012-05-05
    • 2013-03-13
    • 1970-01-01
    相关资源
    最近更新 更多