我正在将我的项目从 PHP 5 迁移到 PHP 7.3,我已经使用替代函数对解密函数进行了更改。但是我面临着一个控制器文件的问题。
相同的代码适用于 PHP5 版本,但是当我尝试为 PHP 7 执行相同的代码时,即使在 errorLog 文件中没有添加任何错误,它也不会给出任何错误。你能帮我解决这个问题吗?
我正在上传我的“error.php”控制器文件。
<?php
class Error extends CI_Controller {
private $controller = "error";
public function __construct() {
parent::__construct();
if ($this->phpsession->get('USERID')) {
$headerContent['controller'] = $this->controller;
$this->load->view('xome/header', $headerContent);
} else {
header("Location:" . ASITEURL . "/login/");
}
}
public function index() {
$this->load->view('x-404');
$this->load->view('xome/footer');
}
public function permission() {
$this->load->view('x-permission');
$this->load->view('xome/footer');
}
public function display() {
$this->load->view('x-error');
$this->load->view('xome/footer');
}
}
?>
当我点击 URL 时,它应该加载查看页面,但无法加载任何查看文件。
http://localhost/--项目文件夹名称--/error/permission
即使我检查了控制器以及任何视图文件中都没有语法错误。
从 PHP7 开始,Error
是一个保留的类名:http://php.net/manual/en/class.error.php。
将其更改为其他内容:
class MyError extends CI_Controller
{
// ....
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句