简体   繁体   English

移至新服务器,现在CodeIgniter / Ion_Auth不起作用

[英]Moving to new server, now CodeIgniter / Ion_Auth are not working

So I am moving to a new host server. 因此,我将移至新的主机服务器。 One of my school projects that is in use on the old server must remain up with no downtime, so I am prepping the new server and moving over all the files associated. 旧服务器上正在使用的我的一个学校项目必须保持正常运行,而不会造成停机,因此,我正在准备新服务器并移动所有关联的文件。 I've got the virtual host all set up and working, now CodeIgniter and Ion_Auth don't seem to be working. 我已经设置好了虚拟主机,并且可以正常工作,现在CodeIgniter和Ion_Auth似乎不起作用。

I am getting the dreadful white screen of death. 我正在看到可怕的死亡白屏。 Here's what I have done so far and in order. 到目前为止,这是我已经按顺序完成的工作。

First, CodeIgniter was looking for the Ion_Auth library under 'core/MY_Ion_Auth.php' so after research I found that I needed to change the __autoload() function (application/config/config.php l# 385) FROM 首先,CodeIgniter在“ core / MY_Ion_Auth.php”下寻找Ion_Auth库,因此在研究之后,我发现需要更改__autoload()函数(application / config / config.php l#385),

function __autoload($class)
{
    if(strpos($class, 'CI_') !== 0)
    {
        @include_once( APPPATH . 'core/'. $class . EXT );
    }
}    

TO

function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        if (file_exists($file = APPPATH . 'core/' . $class . EXT))
        {
            include $file;
        }

        elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT))
        {
            include $file;
        }
    }
} 

And it was a success. 这是成功的。 My script no longer broke after the autoload. 自动加载后,我的脚本不再损坏。 Now, I am still getting a white screen but my log file is showing different errors. 现在,我仍然显示白屏,但是我的日志文件显示了不同的错误。

Here's my log file: 这是我的日志文件:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
ERROR - 2015-01-29 11:55:15 --> Severity: Notice  --> Undefined variable: user /var/www/CIS411-GIS_Conference/application/views/templates/menubar.php 36
ERROR - 2015-01-29 11:55:15 --> Severity: Notice  --> Trying to get property of non-object /var/www/CIS411-GIS_Conference/application/views/templates/menubar.php 36
ERROR - 2015-01-29 11:55:15 --> Severity: Notice  --> Undefined variable: user /var/www/CIS411-GIS_Conference/application/views/templates/menubar.php 39
ERROR - 2015-01-29 11:55:15 --> Severity: Notice  --> Trying to get property of non-object /var/www/CIS411-GIS_Conference/application/views/templates/menubar.php 39

Now, the 'undefined variable' is supposed to be undefined. 现在,“未定义的变量”应该是未定义的。 It is in an if statement checking to see if the user is logged in first (which I am not) therefore, this code shouldn't even be running! 它是在if语句中检查用户是否先登录(但我不是),因此,该代码甚至不应运行!

Here's the menubar.php if statement: 这是menubar.php if语句:

<?
    if ($this->ion_auth->logged_in()) {
        // Get users info
        $user = $this->ion_auth->user()->row();
        // Display account links
?>
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?=$user->email?> <span class="caret"></span></a>
        <ul class="dropdown-menu" role="menu">
          <li <? if(is_active('auth/dashboard')): ?>class="active"<? endif; ?>><a href="<?= site_url('auth/dashboard') ?>">Dashboard</a></li>
          <li <? if(is_active('auth/edit_user')): ?>class="active"<? endif; ?>><a href="<?= site_url('auth/edit_user/'.$user->id) ?>">Account Settings</a></li>
          <li class="divider"></li>
          <li><a href="<?= site_url('auth/logout') ?>">Logout</a></li>
        </ul>
    </li>

All that said, still getting the WSOD and not sure what to do next. 所有这些,仍然得到了WSOD,并且不确定下一步该怎么做。 I did have to change from mysql to mysqli due to pconnect no longer being supported by PHP5.x. 由于PHP5不再支持pconnect,我确实必须从mysql更改为mysqli。 I'm thinking this could have something to do with it but have no idea how to go about fixing it. 我认为这可能与它有关,但不知道如何解决它。

Any help will be appreciated! 任何帮助将不胜感激!

确保在您的PHP.ini中打开了“ output_buffering”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM