本文介绍了消息:call_user_func_array()期望参数1是有效的回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遇到PHP错误
严重性:警告

A PHP Error was encounteredSeverity: Warning

消息:call_user_func_array()期望参数1为有效的回调,而类'Error'则不是有一个方法'index'

Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'Error' does not have a method 'index'

文件名:core / CodeIgniter.php

Filename: core/CodeIgniter.php

行号:532

回溯:

文件:/var/www/monitors/index.php
行:315
功能:require_once

File: /var/www/monitors/index.phpLine: 315Function: require_once

在我的本地系统中工作正常,但我移到服务器时遇到此错误

In my local system working fine but i move to the server i got this error

推荐答案

我遇到了类似的错误,我将 Error 类重命名为 Errors application / controllers / Errors.php 中。在 config / routes.php 中,我相应地更改了类名:

I got a similar error that I solved by renaming the Error class to Errors in application/controllers/Errors.php. In config/routes.php I changed the class name accordingly:

$route['404_override'] = "errors/page_missing";

这篇关于消息:call_user_func_array()期望参数1是有效的回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 02:40