I am using slim version 3.8 and I want to disable outputBuffering and show all errors: Following is my simple Hello World program.
require_once(dir.'/vendor/autoload.php');
$configuration = [
'settings' => [
'displayErrorDetails' => true,
'outputBuffering' => false,
],
];
$app = new \Slim\App($configuration);
// Add route callbacks
$app->get('/', function ($request, $response, $args) {
echo "here";
return $response->withStatus(200)->write('Hello World!');
});
// Run application
$app->run();
If I comment out echo "here"; then it works fine. But this code is throwing exception - 500 internal error saying that "Unexpected data in output buffer. Maybe you have characters before an opening". Can someone please tell me what's going wrong here?