Update script path in shell_exec command

Changed the script path in the shell_exec command to include a forward slash before 'script.php' for correct execution.
This commit is contained in:
Jeroen De Meerleer 2024-06-14 20:31:09 +02:00
parent 8af61f97b0
commit f3513ea80e
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -4,7 +4,7 @@ if($_SERVER["REQUEST_URI"] == '/metrics') {
header('Content-Type: text/plain; version=0.0.4'); header('Content-Type: text/plain; version=0.0.4');
$config = getenv('CONFIG_FILE'); $config = getenv('CONFIG_FILE');
$phpbin = getenv('PHP_BINARY'); $phpbin = getenv('PHP_BINARY');
$output = shell_exec('CONFIG_FILE="' . $config . '" ' . $phpbin . ' ' . $_SERVER['DOCUMENT_ROOT'] . 'script.php'); $output = shell_exec('CONFIG_FILE="' . $config . '" ' . $phpbin . ' ' . $_SERVER['DOCUMENT_ROOT'] . '/script.php');
echo $output; echo $output;
} elseif ($_SERVER["REQUEST_URI"] == '/config') { } elseif ($_SERVER["REQUEST_URI"] == '/config') {
header('Content-Type: application/json'); header('Content-Type: application/json');