Skip to content

Commit e4be02a

Browse files
ShaiMagalfabpot
authored andcommitted
[HttpKernel] Preventing error 500 when function putenv is disabled
1 parent 6765a43 commit e4be02a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,9 @@ private function preBoot(): ContainerInterface
778778
$this->startTime = microtime(true);
779779
}
780780
if ($this->debug && !isset($_ENV['SHELL_VERBOSITY']) && !isset($_SERVER['SHELL_VERBOSITY'])) {
781-
putenv('SHELL_VERBOSITY=3');
781+
if (\function_exists('putenv')) {
782+
putenv('SHELL_VERBOSITY=3');
783+
}
782784
$_ENV['SHELL_VERBOSITY'] = 3;
783785
$_SERVER['SHELL_VERBOSITY'] = 3;
784786
}

0 commit comments

Comments
 (0)