Skip to content

Commit

Permalink
only warn on missing json extension (#2805)
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Aug 22, 2024
1 parent 5f1390b commit 4b2f6db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datadog-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,11 @@ function check_php_ext_prerequisite_or_exit($binary, $extName)
{
$extensions = shell_exec(escapeshellarg($binary) . " -m");

// See: https://github.com/DataDog/dd-trace-php/issues/2787
if ($extensions === null || $extensions === false || strpos($extensions, '[PHP Modules]') === false) {
echo "WARNING: The output of '$binary -m' could not be reliably checked. Please make sure you have the PHP extension '$extName' installed.\n";
return;
}
if (!in_array($extName, array_map("trim", explode("\n", $extensions)))) {
print_error_and_exit("Required PHP extension '$extName' not found.\n");
}
Expand Down

0 comments on commit 4b2f6db

Please sign in to comment.