Skip to content

Use configured PHP executable path in ToolExecutor subprocess#730

Merged
pushpak1300 merged 2 commits intomainfrom
fix/tool-executor-php-executable-path
Mar 31, 2026
Merged

Use configured PHP executable path in ToolExecutor subprocess#730
pushpak1300 merged 2 commits intomainfrom
fix/tool-executor-php-executable-path

Conversation

@pushpak1300
Copy link
Copy Markdown
Member

When running Boost's MCP server via HTTP transport (Mcp::web()) behind PHP-FPM, ToolExecutor uses PHP_BINARY to spawn subprocesses — which resolves to php-fpm instead of php, breaking all tool calls. The boost.executable_paths.php config already exists and is respected elsewhere, but ToolExecutor wasn't using it.

Fixes #723

Approach

  • Extracted the command normalization logic (absolute path detection, multi-token command splitting) into a shared CommandNormalizer helper so it can be reused
  • Updated ToolExecutor::buildCommand() to read the configured PHP path with PHP_BINARY as fallback
  • Added tests for absolute paths with spaces, multi-token wrappers like herd php, and the default fallback

@pushpak1300 pushpak1300 marked this pull request as ready for review March 28, 2026 12:38
@pushpak1300 pushpak1300 merged commit 592af01 into main Mar 31, 2026
22 checks passed
@pushpak1300 pushpak1300 deleted the fix/tool-executor-php-executable-path branch March 31, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Mcp::web() HTTP transport in ToolExecutor

1 participant