我正在尝试使用zeuxisoo/slim-whoops来显示错误,但出于某种原因,我只是在没有任何消息显示的情况下获得白屏。这是我正在使用的代码(我不知道它是否重要,我使用快速PHP主机(php -S localhost:8000):
require __DIR__ . '/../vendor/autoload.php';
$app = new Slim\App([
'settings' => [
'displayErrorDetails' => true,
'debug' => true,
'whoops.editor' => 'sublime',
]
]);
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware);
答案 0 :(得分:5)
确保您的文件以<?php
开头,并在$app->add(...);
致电$app->run();
之后:
<?php
require __DIR__ . '/../vendor/autoload.php';
$app = new Slim\App([
'settings' => [
'displayErrorDetails' => true,
'debug' => true,
'whoops.editor' => 'sublime',
]
]);
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware);
$app->run();