Symfony Process is a PHP library for executing external commands in separate operating-system processes with full lifecycle control. It provides a cross-platform command executor that handles OS-specific argument escaping and process management, enabling portable subprocess execution from PHP applications.
The library supports both synchronous and asynchronous process execution, allowing background subprocesses to run independently while the main PHP script continues. It includes executable path resolution to locate system commands across standard search directories, stream-based I/O pipes for real-time reading and writing to subprocess stdin, stdout, and stderr, and timeout-driven process termination with configurable limits. Signal dispatch abstraction enables sending POSIX signals to subprocesses with platform-specific handling, while the PHP code isolation runner can execute PHP snippets in separate processes with independent configuration and environment.
Additional capabilities include setting environment variables for subprocesses, stopping running processes with optional timeout and specific signals, and streaming process output incrementally using iterators or callbacks. The library also provides executable discovery to find absolute paths of system commands and binaries across different operating systems.