Symfony Process

Execute and manage sub-processes from PHP with a safe, cross-platform, streaming API

Library
Composer
vv8.1.0
7,454stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
75/100Good
Development Activity68
Maintenance72
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture86
Code Quality88
Innovation72
Learning Curve82

Symfony Process is a standalone PHP component for executing external commands as sub-processes without dealing with exec(), proc_open(), or shell-escaping pitfalls directly. It wraps process creation in a Process class that handles argument escaping, timeouts, working directories, environment variables, and streaming stdout/stderr in real time, on both Unix-like systems and Windows.

As one of Symfony’s foundational, framework-agnostic components, it’s usable in any PHP project regardless of whether the rest of the app runs on Symfony, and with roughly 17.3 million monthly Composer installs it’s a de facto standard for shelling out safely from PHP — used by tools like Composer itself, PHPUnit-adjacent tooling, and countless deployment and build scripts.

What You Get

  • A Process class for running external commands with automatic, safe argument escaping (no manual shell-quoting)
  • Synchronous (run()) and asynchronous (start()) execution modes with real-time stdout/stderr callbacks
  • Configurable timeouts, idle timeouts, working directory, and environment variables per process
  • An ExecutableFinder for locating binaries across PATH and common installation locations
  • Cross-platform support, including Windows-specific quirks like CreateNewConsole handling
  • A PhpProcess/PhpSubprocess helper for spawning child PHP processes with the correct interpreter and ini settings

Common Use Cases

  • Running shell commands (git, npm, rsync, etc.) from a PHP deploy script or Symfony console command without manual escaping
  • Streaming build or migration tool output back to a CLI in real time via the process’s output callback
  • Enforcing a timeout on a long-running external command so it can’t hang a web request or worker indefinitely
  • Spawning isolated PHP subprocesses (e.g. for parallel test runners or sandboxed script execution)

Under The Hood

Architecture — The component centers on Process.php, which wraps proc_open() and manages an internal Pipes abstraction (Pipes/UnixPipes.php, Pipes/WindowsPipes.php) to handle platform-specific stream and pipe quirks, particularly around Windows’ blocking-pipe behavior. InputStream.php supports feeding data to a running process’s stdin incrementally, and ExecutableFinder/PhpExecutableFinder locate binaries and the PHP interpreter itself across different environments; a Messenger subdirectory integrates with Symfony Messenger for running commands as async message handlers.

Tech Stack — Requires PHP 8.4.1+ on its current development branch (older tagged releases support earlier PHP versions per Symfony’s backward-compatibility promise) with zero required third-party dependencies — it only depends on core PHP process-control functions, keeping the component lightweight enough to use outside the Symfony framework entirely.

Code Quality — 41 PHP files include a substantial Tests/ suite covering ExecutableFinderTest, PhpProcessTest, edge cases like non-stoppable processes and output memory limits (NonStopableProcess.php, OutputMemoryLimitProcess.php), and Windows console-creation behavior (CreateNewConsoleTest.php) — indicating deliberate coverage of the platform-specific edge cases process management is notorious for. With 201 contributors and a century of monthly releases across supported branches, the component follows Symfony’s disciplined, backward-compatible release process.

API Design — The Process class follows a consistent builder-like pattern (Process::fromShellCommandline() or array-based constructor, then run()/start()/wait()), and array-based command construction is favored specifically to avoid shell-injection footguns that plague raw exec()/shell_exec() usage — a deliberate safety-first design choice documented throughout the README and official docs.

Used by 8 apps in this directory

PHP
66%
AGPL 3.0

EspoCRM

Marketing · Ecommerce · CRM

3,259

Open-source CRM platform with metadata-driven customization, field-level permissions, and a full REST API — deploy on your own infrastructure.

View details
97
Repo Health
72
Technical
64
Dependency
Built with
PHP66%
JavaScript24%
Updated yesterday
PHP
91%
AGPL 3.0

FreeScout

Customer Support

4,484

Run your own help desk and shared inbox — a fully self-hosted, open-source alternative to Zendesk and Help Scout with no per-agent fees.

View details
93
Repo Health
55
Technical
63
Dependency
Built with
PHP91%
Updated yesterday
PHP
63%
AGPL 3.0

Hyvor Relay

Devops · AI Development · Monitoring

819

Self-hosted, open-source email API that automates DNS, manages SMTP delivery, and provides deep observability — replacing SES, Mailgun, and SendGrid with infrastructure you fully own.

View details
69
Repo Health
79
Technical
70
Dependency
Built with
PHP63%
Svelte23%
Go12%
Updated today
PHP
86%
AGPL 3.0

Kimai

Invoicing Finance · Project Management

4,918

Professional open-source time tracking with invoicing, multi-user support, SAML/LDAP auth, and a full REST API—self-host it or use the cloud.

View details
94
Repo Health
78
Technical
63
Dependency
Built with
PHP86%
Updated today
PHP
79%
GPL 3.0

matomo

Analytics

21,786

Open-source, privacy-first web and app analytics that puts you in complete control of your data.

View details
95
Repo Health
82
Technical
62
Dependency
Built with
PHP79%
Updated today
PHP
82%
Other

Mautic

Automation · Marketing · Ecommerce

10,366

The world's largest open source marketing automation platform — own your data, run multi-channel campaigns, and escape vendor lock-in forever.

View details
98
Repo Health
76
Technical
64
Dependency
Built with
PHP82%
Updated yesterday
PHP
99%
MIT

Shlink

Developer Tools · Marketing

5,223

Self-hosted PHP URL shortener with a full REST API, dynamic redirect rules, and real-time visit analytics under your own domain.

View details
86
Repo Health
83
Technical
72
Dependency
Built with
PHP99%
Updated 1 weeks ago
PHP
84%
MIT

wallabag

Bookmarks Archiving

12,917

Self-hosted read-it-later app that saves clean, ad-free articles from any webpage for distraction-free reading across all your devices.

View details
92
Repo Health
81
Technical
59
Dependency
Built with
PHP84%
Twig13%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search