gpt4 book ai didi

php - 转移到新服务器,现在 CodeIgniter/Ion_Auth 无法工作

转载 作者:行者123 更新时间:2023-11-29 23:07:47 26 4
gpt4 key购买 nike

所以我要转移到新的主机服务器。我在旧服务器上使用的一个学校项目必须保持正常运行,不得停机,因此我正在准备新服务器并移动所有关联的文件。我已将虚拟主机设置完毕并正常工作,但现在 CodeIgniter 和 Ion_Auth 似乎无法正常工作。

我遇到了可怕的白屏死机。这是我迄今为止按顺序所做的事情。

首先,CodeIgniter 正在“core/MY_Ion_Auth.php”下寻找 Ion_Auth 库,因此经过研究,我发现我需要更改 __autoload() 函数 (application/config/config.php l# 385) FROM

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

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;
}
}
}

而且它很成功。自动加载后我的脚本不再中断。现在,我仍然看到白屏,但我的日志文件显示不同的错误。

这是我的日志文件:

<?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

现在,“ undefined variable ”应该是未定义的。它在 if 语句中检查用户是否首先登录(我没有),因此,该代码甚至不应该运行!

这是 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>

尽管如此,仍然收到 WSOD 并且不确定下一步该做什么。由于 PHP5.x 不再支持 pconnect,我确实必须从 mysql 更改为 mysqli。我认为这可能与此有关,但不知道如何修复它。

任何帮助将不胜感激!

最佳答案

确保 PHP.ini 中的“output_buffering”已打开

关于php - 转移到新服务器,现在 CodeIgniter/Ion_Auth 无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28220924/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com