Skip to content

Commit dbe220a

Browse files
authored
Merge pull request #267 from brefphp/force-error-logging-fpm
Fix some internal fatal errors not logged by forcing `display_errors=1` in the bootstrap process
2 parents 5cf23d1 + fdef647 commit dbe220a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

layers/bootstrap.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php declare(strict_types=1);
22

3+
// Force errors to be logged to stdout so that they end up in CloudWatch.
4+
// In the `function` runtime this is already `1`, but in the `fpm` runtime it is `0` by default.
5+
// Here we are forcing it to `1` in the bootstrap process, it will not impact the application code
6+
// as it runs in different processes (FPM worker) and those will have `display_errors=0`.
7+
ini_set('display_errors', '1');
8+
39
$appRoot = getenv('LAMBDA_TASK_ROOT');
410

511
$autoloadPath = $_SERVER['BREF_AUTOLOAD_PATH'] ?? null;

0 commit comments

Comments
 (0)