symfony/process · error · RuntimeException
Unable to find the PHP executable.
Error message
Unable to find the PHP executable.
What it means
Thrown at the start of PhpProcess::start when the command line is empty because no PHP binary could be located: PhpExecutableFinder::find() returned false during construction and no explicit executable was provided.
Solutions
- Pass an explicit PHP binary path via the $php constructor argument
- Ensure the PHP executable is on PATH or point PHP_BINARY appropriately
- Verify the runtime environment where the process is spawned
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at PhpProcess.php:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of symfony/process@99b85026db (2026-09-14).
Data as JSON: /api/errors/d9e4247851f9ae98.
Report an issue: GitHub.
Appendix: source
Thrown at PhpProcess.php:67
$script = null;
}
parent::__construct($php, $cwd, $env, $script, $timeout);
}
public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static
{
throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class));
}
/**
* @param (callable('out'|'err', string):void)|null $callback
* @param EnvArray $env
*/
public function start(?callable $callback = null, array $env = []): void
{
if (null === $this->getCommandLine()) {
throw new RuntimeException('Unable to find the PHP executable.');
}
parent::start($callback, $env);
}
}
View on GitHub (pinned to 99b85026db)