['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w'] ], $pipes); if (is_resource($proc)) { fwrite($pipes[0], $raw_msg); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($proc); } } elseif (file_exists($index_php)) { $cmd = "php $index_php"; $proc = proc_open($cmd, [ 0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w'] ], $pipes); if (is_resource($proc)) { fwrite($pipes[0], $raw_msg); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($proc); } } if (!$is_cli) { http_response_code(200); echo "Webhook processed successfully."; }