Skip to content

Commit 2519b17

Browse files
committed
Force display_errors
1 parent 5123ffb commit 2519b17

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/FpmRuntime/FpmHandler.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,15 @@ public function start(): void
7878
* --force-stderr: force logs to be sent to stderr, which will allow us to send them to CloudWatch
7979
* TODO set `max_execution_time` to the timeout of the Lambda function?
8080
*/
81-
$resource = @proc_open(['php-fpm', '--nodaemonize', '--force-stderr', '--fpm-config', $this->configFile], [], $pipes);
81+
$resource = @proc_open([
82+
'php-fpm',
83+
'--nodaemonize',
84+
'--force-stderr',
85+
'--fpm-config', $this->configFile,
86+
// Override ini settings to force disabling display_errors
87+
// Displaying errors in the HTTP response is a security risk
88+
'-d', 'display_errors=0',
89+
], [], $pipes);
8290

8391
if (! is_resource($resource)) {
8492
throw new RuntimeException('PHP-FPM failed to start');

0 commit comments

Comments
 (0)