8000 [Process] Suppress warnings when open_basedir is non-empty by cbj4074 · Pull Request #27141 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Process] Suppress warnings when open_basedir is non-empty #27141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 #16182 .

This has always been an issue, but 709e15e7a37cb7ed6199548dc70dc33168e6cb2d made it more likely that a warning is triggered.
  • Loading branch information
cbj4074 authored May 3, 2018
commit 34f136e01b9f3246f4d8debca0153d9df143761c
6 changes: 3 additions & 3 deletions src/Symfony/Component/Process/PhpExecutableFinder.php
82CE
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ public function find($includeArgs = true)
}

if ($php = getenv('PHP_PATH')) {
if (!is_executable($php)) {
if (@!is_executable($php)) {
return false;
}

return $php;
}

if ($php = getenv('PHP_PEAR_PHP_BIN')) {
if (is_executable($php)) {
if (@is_executable($php)) {
return $php;
}
}

if (is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
if (@is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
return $php;
}

Expand Down
0