使用Ion Auth和Facebook登录的PHP登录可以在MAMP上本地工作,但不能在Web服务器上工作

使用Ion Auth和Facebook登录的PHP登录可以在MAMP上本地工作,但不能在Web服务器上工作,php,facebook,codeigniter,ion-auth,Php,Facebook,Codeigniter,Ion Auth,我面临的问题是手动新用户订阅在本地工作,但在远程web服务器上不工作。非工作版本和工作版本之间的唯一区别是,我将Ion Auth升级到了版本2,并为Facebook登录添加了Facebook Ion Auth库 同样,它在本地工作得很好,但在web服务器上却不行。PHP版本已经过测试,运行良好 这是它卡住的控制器(显示空白页或返回主页) 如果没有更多信息,可能不是问题,而是: $group\u id=array('user\u groups'=>2)应该是$group\u id=array('2

我面临的问题是手动新用户订阅在本地工作,但在远程web服务器上不工作。非工作版本和工作版本之间的唯一区别是,我将Ion Auth升级到了版本2,并为Facebook登录添加了Facebook Ion Auth库

同样,它在本地工作得很好,但在web服务器上却不行。PHP版本已经过测试,运行良好

这是它卡住的控制器(显示空白页或返回主页)


如果没有更多信息,可能不是问题,而是:

$group\u id=array('user\u groups'=>2)
应该是
$group\u id=array('2')

请参阅寄存器函数的用法


在Ion auth配置文件中,
$config['identity']
应该设置为电子邮件(如果您还没有这样做)。

可能不是问题,但您应该删除
$this->CI=&get_instance()来自控制器构造函数。“不工作”和“卡住”的确切含义是什么?它被“卡住”的代码是什么?我很困惑,你说它在本地工作而不是远程工作,然后你说不工作的代码在各个方面都与本地代码不同,因为你升级了整个系统?这应该是给你的教训。在尽可能匹配生产环境的服务器上开发。从您的开发分支推动对生产的更改,而不仅仅是在这里和那里更改代码,并期望一切正常。你根本不知道发生了什么,这是个不好的地方。从中学习,因为我们可能帮不了你。
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Signup extends CI_Controller {

    function __construct()
    {
        parent::__construct();
        $this->CI =& get_instance();
        $this->load->library('form_validation');
        $this->load->helper('url');
        $this->load->library('forms/signupform');
        $this->form_validation->set_error_delimiters(
                        $this->config->item('error_start_delimiter', 'ion_auth'),
                        $this->config->item('error_end_delimiter', 'ion_auth')
                );
    }
    /**
     * @signup page of freelancer
     */
    public function index()
    {
        $data['title']  = lang('title_registration');
        $data['bodyclass'] = 'hold-transition register-page';
        $data['js_bottom_files'] = array('plugins/iCheck/icheck.min', 'js/custom');
        $data['cssfiles'] = array('plugins/iCheck/square/blue');

        // POST SIGNUP FORM
        if ('POST' == $this->input->server('REQUEST_METHOD')  && $this->input->post('registersubmit') ) {
            // Signup Action
            $data['message_success'] = $this->signup();
        }

        // $user['checked'] = '';
        // if ($this->input->post('agree') == 'yes') {
        //  $user['checked'] = 'checked';
        // }

        $data['form'] = $this->signupform->view($user);

        //Render Or redirect according to User AccessLevel
        if (!$this->ion_auth->logged_in()) {
            $this->template->load('layout', 'home', $data);
        } elseif ($this->ion_auth->is_admin()) {
            redirect(site_url('admin/dashboard'), 'refresh');
        } elseif ($this->ion_auth->is_members()) {
            redirect(site_url('note/create'), 'refresh');
        }
    }

    /**
     * @Signup action for user
     */
    public function signup()
    {
        $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
        // $this->form_validation->set_rules('full_name', lang('label_full_name'), 'required');
        $this->form_validation->set_rules('loginPassword', lang('label_signup_createpassword'), 'required|min_length['.$this->config->item('min_password_length', 'ion_auth').']|max_length['.$this->config->item('max_password_length', 'ion_auth').']');
        // $this->form_validation->set_rules('confirmpassword', lang('label_signup_confirmpassword'), 'required');
        // $this->form_validation->set_rules('agree', 'Agree', 'required');

        if ($this->form_validation->run() == true) {
            $email    = $this->input->post('email');
            $password = $this->input->post('loginPassword');

            // $additional_data = array('first_name' => $this->input->post('full_name'), 'school' => $this->input->post('school_name'));

            $group_ids = array( 'user_groups' => 2);

            if ($this->ion_auth->register($email, $password, $email, $additional_data, $group_ids)) {
                //check to see if we are creating the user
                //$this->session->set_flashdata('message_success', $this->ion_auth->messages());
                //redirect(site_url('/'), 'refresh');
                if($this->ion_auth->login($email, $password)){
                    redirect(site_url('note/create'), 'refresh');
                }
            } else {
                $this->session->set_flashdata('message_error', $this->ion_auth->errors());
                redirect(site_url('/'), 'refresh');
            }
        }
    }
}

/* End of file signup.php */