Zend framework2 Zend 2.2.5错误“初始值设定项应可调用”

Zend framework2 Zend 2.2.5错误“初始值设定项应可调用”,zend-framework2,Zend Framework2,我在共享主机上工作,可以选择PHP版本:5.4.23或5.3.28 我想使用最新的Zend 2.2.5,但在PHP版本5.4.23上,我发现错误: Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message '$initializer should be callable.' in /home/rr197664/public_html/domain.c

我在共享主机上工作,可以选择PHP版本:5.4.23或5.3.28

我想使用最新的Zend 2.2.5,但在PHP版本5.4.23上,我发现错误:

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message '$initializer should be callable.' 
in /home/rr197664/public_html/domain.com/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:366 Stack trace: 
。。。

当我切换到PHP5.3.28时,页面打开,但所有重定向$this->redirect->toRoute停止工作

我在Zendskletonapplication上测试了它

你知道能做什么吗

谢谢

将替换的服务器路径编辑为…:

Current PHP version: 5.4.23

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message '$initializer should be callable.' in .../Zend/ServiceManager/ServiceManager.php:366 Stack trace:

0 .../Zend/Mvc/Service/ServiceManagerConfig.php(142): Zend\ServiceManager\ServiceManager->addInitializer(NULL) 

1 /.../Zend/ServiceManager/ServiceManager.php(128): Zend\Mvc\Service\ServiceManagerConfig->configureServiceManager(Object(Zend\ServiceManager\ServiceManager)) 

2 /.../Zend/Mvc/Application.php(251): Zend\ServiceManager\ServiceManager->__construct(Object(Zend\Mvc\Service\ServiceManagerConfig)) 

3 /.../public/index.php(19): Zend\Mvc\Application::init( in /.../Zend/ServiceManager/ServiceManager.php on line 366

转到上次编辑的模块。openmodule.php

在你的职责范围内

public function getServiceConfig() 
或者

public function  getViewHelperConfig() 

你有一个无法找到的工厂的引用,或者一个没有正确格式的内联函数

你能发布堆栈跟踪吗?添加到主帖子中,谢谢你能看到类似的错误。这个错误非常明显;它清楚地向您显示NULL正在传递给ServiceManager->addInitializerNULL,这意味着您的module.config中有一个不正确的“初始值设定项”,它们的形式应该是“初始值设定项”=>数组“serviceName”=>“className”。我猜您只输入了类名或服务名,没有输入其他名称。这是ZendskeletonApp的新安装版-我没有编辑其中的一行。它可以在PHP5.3.28上运行,但当我切换到5.4.23时,上面出现了错误。我没有编辑任何内容,这是全新的instal o Zendskeleton应用程序,它可以在PHP5.3.28上运行,但不能在5.4.23上运行。它可能是一些服务器php设置吗?它可能是您另外安装的任何模块。ZendSkeleton与刚刚测试的2.2.5完美配合。可能只是尝试重新安装,可能有一个损坏的文件左右。嗨山姆,我重新插入ZendSkeleton,但错误仍然存在。奇怪的是,它在PHP5.3.28上工作,但当我切换到5.4.23时,上面出现了错误。有什么想法吗?最新版本的php之间存在一些已知的不兼容,如数组的简短语法、可调用/闭包定义等。可能有一些我们以前从未见过的东西卡洛斯/山姆谢谢你的所有回答,所以我将尝试使用5.3.28,但据我所知,Zend推荐5.3.3