# symfony/process

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/symfony-process).**

7,463 stars · 105 forks · PHP · MIT

## Links

- GitHub: https://github.com/symfony/process
- Homepage: https://symfony.com/process
- awesome-repositories: https://awesome-repositories.com/repository/symfony-process.md

## Topics

`component` `php` `symfony` `symfony-component`

## Description

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.

## Tags

### DevOps & Infrastructure

- [Subprocess Executions](https://awesome-repositories.com/f/devops-infrastructure/remote-command-execution/php-wrapper-command-execution/subprocess-executions.md) — Executes external commands in separate operating-system processes with full lifecycle control.
- [Process Input Streaming](https://awesome-repositories.com/f/devops-infrastructure/execution-environments/remote-workspace-command-execution/ssh-based-remote-execution/remote-data-streaming/process-input-streaming.md) — Provides writable streams that send data to the standard input of running processes.
- [Execution Timeouts](https://awesome-repositories.com/f/devops-infrastructure/execution-timeouts.md) — Limits how long a subprocess may run before it is automatically terminated. ([source](https://symfony.com/doc/current/components/process.html))
- [Background Process Offloading](https://awesome-repositories.com/f/devops-infrastructure/workflow-run-management/asynchronous-run-launches/background-process-offloading.md) — Starts a subprocess and lets it run in the background while the main program continues. ([source](https://symfony.com/doc/current/components/process.html))

### Development Tools & Productivity

- [Shell Argument Escapers](https://awesome-repositories.com/f/development-tools-productivity/command-argument-parsers/shell-argument-escapers.md) — Escapes shell arguments and command strings to prevent injection and handle OS-specific quoting rules.
- [Portable Command Executors](https://awesome-repositories.com/f/development-tools-productivity/cross-platform-command-executions/portable-command-executors.md) — Handles OS-specific argument escaping and process management for portable command execution.
- [Executable Locators](https://awesome-repositories.com/f/development-tools-productivity/custom-command-execution/scheduled-command-execution/executable-locators.md) — Locates the absolute path of a command or binary by searching standard and custom directories. ([source](https://symfony.com/doc/current/components/process.html))
- [Isolated Process Runners](https://awesome-repositories.com/f/development-tools-productivity/php-development-environments/isolated-process-runners.md) — Runs PHP snippets in isolated subprocesses with independent configuration and environment.
- [Synchronous Subprocess Runners](https://awesome-repositories.com/f/development-tools-productivity/subprocess-management/subprocess-bootstrapping/synchronous-subprocess-runners.md) — Runs an external command in a separate process and waits for it to finish. ([source](https://cdn.jsdelivr.net/gh/symfony/process@8.2/README.md))
- [Subprocess Execution](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/cli-tooling-frameworks/cli-tooling/server-cli/subprocess-execution.md) — Executes an external command in a separate process, handling OS differences and argument escaping. ([source](https://symfony.com/doc/current/components/process.html))
- [Process Execution Wrappers](https://awesome-repositories.com/f/development-tools-productivity/text-wrapping-utilities/process-execution-wrappers.md) — Wraps OS fork/exec system calls to run external commands in a separate process with full lifecycle control.

### Operating Systems & Systems Programming

- [Process Output Iteration](https://awesome-repositories.com/f/operating-systems-systems-programming/file-i-o-management/sequential-line-processing/process-output-iteration.md) — Reads command output incrementally as it is produced, using an iterator or a callback. ([source](https://symfony.com/doc/current/components/process.html))
- [I/O Stream Configuration](https://awesome-repositories.com/f/operating-systems-systems-programming/i-o-stream-configuration.md) — Connects subprocess stdin, stdout, and stderr as PHP streams for real-time reading and writing.
- [Individual Process Signalers](https://awesome-repositories.com/f/operating-systems-systems-programming/process-signal-forwarding/process-group-signaling/individual-process-signalers.md) — Transmits a POSIX signal to an asynchronous subprocess with the option to ignore certain signals. ([source](https://symfony.com/doc/current/components/process.html))
- [Process Termination Signals](https://awesome-repositories.com/f/operating-systems-systems-programming/process-termination-signals.md) — Sends POSIX signals to subprocesses for graceful shutdown and timeout-based termination.
- [Timeout-Driven Terminators](https://awesome-repositories.com/f/operating-systems-systems-programming/process-termination-signals/timeout-driven-terminators.md) — Automatically terminates a subprocess after a configurable timeout duration.
- [Subprocess Management Libraries](https://awesome-repositories.com/f/operating-systems-systems-programming/subprocess-management-libraries.md) — Provides high-level programmatic control over the execution, lifecycles, and timeouts of external system processes.
- [Executable Locators](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/file-system-management/file-system-utilities/source-path-locators/executable-locators.md) — Searches system paths to identify the location of required binaries.
- [Process Signal Dispatchers](https://awesome-repositories.com/f/operating-systems-systems-programming/system-signal-handling/process-signal-dispatchers.md) — Abstracts POSIX signal sending to subprocesses with platform-specific handling and ignore options.

### Programming Languages & Runtimes

- [Process Polling](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/asynchronous-processing/asynchronous-processing/process-polling.md) — Polls subprocess status in a non-blocking loop to detect completion while the main program continues.
- [PHP Code Isolators](https://awesome-repositories.com/f/programming-languages-runtimes/php-code-generators/php-code-isolators.md) — Spawns a separate PHP process with its own configuration to execute code in an isolated environment.

### Scientific & Mathematical Computing

- [Asynchronous Process Terminators](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithms/graph-processing/shortest-path-algorithms/a-star-search/hierarchical-a-implementations/asynchronous-process-terminators.md) — Terminates an asynchronous subprocess, optionally after a timeout and with a specific signal. ([source](https://symfony.com/doc/current/components/process.html))

### Software Engineering & Architecture

- [Subprocess Environment Injectors](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/environment-variable-management/environment-variables/environment-variable-sets/subprocess-environment-injectors.md) — Passes custom environment variables to a subprocess, optionally overriding system defaults. ([source](https://symfony.com/doc/current/components/process.html))
- [Asynchronous Process Managers](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-process-managers.md) — Starts background subprocesses with timeout, signal, and streaming output support.
- [Binary Path Discovery](https://awesome-repositories.com/f/software-engineering-architecture/dynamic-path-configuration/binary-path-discovery.md) — Locates absolute paths of system commands and binaries across standard search directories.
- [Executable Path Resolvers](https://awesome-repositories.com/f/software-engineering-architecture/dynamic-path-configuration/binary-path-discovery/binary-path-execution/executable-path-resolvers.md) — Resolves command names to absolute file paths by searching system PATH and custom directories.
