8000 Suppress warnings when open_basedir is non-empty · symfony/process@a6d452f · GitHub
[go: up one dir, main page]

Skip to content

Commit a6d452f

Browse files
authored
Suppress warnings when open_basedir is non-empty
If PHP is configured *with a non-empty open_basedir* value that does not permit access to the target location, these calls to is_executable() throw warnings. While Symfony may not raise exceptions for warnings in production environments, other frameworks (such as Laravel) do, in which case any of these checks causes a show-stopping 500 error. We fixed a similar issue in the ExecutableFinder class via symfony/symfony#16182 . This has always been an issue, but 709e15e made it more likely that a warning is triggered.
1 parent 9033c46 commit a6d452f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PhpExecutableFinder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ public function find($includeArgs = true)
4949
}
5050

5151
if ($php = getenv('PHP_PATH')) {
52-
if (!is_executable($php)) {
52+
if (@!is_executable($php)) {
5353
return false;
5454
}
5555

5656
return $php;
5757
}
5858

5959
if ($php = getenv('PHP_PEAR_PHP_BIN')) {
60-
if (is_executable($php)) {
60+
if (@is_executable($php)) {
6161
return $php;
6262
}
6363
}
6464

65-
if (is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
65+
if (@is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
6666
return $php;
6767
}
6868

0 commit comments

Comments
 (0)
0