Zend Framework 2项目:某些模块在Macbook MAMPP中是白屏,但在LAMP或xampp环境中正常运行。设置了E_ALL
答案 0 :(得分:0)
您的渲染器可能会生成您未看到的错误,请尝试将自己附加到EVENT_DISPATCH_ERROR和EVENT_RENDER_ERROR以找出异常是什么。
示例Module.php:
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$eventManager->attach(array(
MvcEvent::EVENT_DISPATCH_ERROR,
MvcEvent::EVENT_RENDER_ERROR,
), function(\Zend\Mvc\MvcEvent $event) use ($serviceManager)
{
if ($event->getError() === \Zend\Mvc\Application::ERROR_EXCEPTION)
{
$exception = $event->getParam('exception');
// Do something with this Exception, like logging in.
}
}
);
}
}
答案 1 :(得分:0)
error_reporting
E_ALL
设置为php.ini
(这是开发环境的建议值)
display_errors = On
php.ini