当产生解析错误时,例如在控制器内部,ZF2异常处理程序捕获它,我只看到
An error occurred during execution; please try again later.
No exception available
如果我在public/index.php
中产生解析错误,我可以在浏览器中看到普通的PHP错误,所以PHP设置是正确的。
我如何强迫ZF2在开发模式下显示这样的错误?
原来我使用的是旧版本的view/error/index.phtml
(骨架应用程序的一部分),它不准备错误类型的错误(自PHP 7),只处理异常类型的错误。
Had to change this line
<?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
<?php if (isset($this->exception) && ($this->exception instanceof 'Exception || $this->exception instanceof 'Error)) : ?>