Skip to content

Commit 8e9b2b1

Browse files
committed
feat(client): use PHP_BINARY constant for portable PHP executable detection
1 parent 9d76ea1 commit 8e9b2b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/env-stdio-client.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ public function has($id): bool
6666

6767
echo "=== PHP MCP Environment Variables Demo ===\n\n";
6868

69+
// Use PHP_BINARY constant for portable PHP executable detection
70+
$phpPath = PHP_BINARY;
71+
echo "Using PHP executable: {$phpPath}\n\n";
72+
6973
// Connect to server with custom environment variables
7074
echo "1. Connecting to MCP server with custom environment variables...\n";
7175
$session = $client->connect('stdio', [
72-
'command' => '/opt/homebrew/opt/[email protected]/bin/php',
76+
'command' => $phpPath,
7377
'args' => [__DIR__ . '/env-stdio-server.php'],
7478
'env' => [
7579
// Custom environment variables that will be passed to the server

0 commit comments

Comments
 (0)