- What does symfony/runtime actually do?
- It decouples PHP application bootstrapping from global state by splitting startup into a RuntimeInterface that resolves environment and options and produces an application, plus a RunnerInterface that drives the app and returns an exit code. Built-in runtimes include GenericRuntime and SymfonyRuntime, with ClosureRunner and SymfonyRunner. It formalises the front-controller seam used by frameworks.
- Does symfony/runtime work with Laravel out of the box?
- Not really. SymfonyRuntime is tied to Symfony KernelInterface and HttpKernelInterface plus Symfony Dotenv, while Laravel uses Illuminate Foundation Application and Illuminate Contracts Http Kernel. You need to author a Laravel-specific RuntimeInterface and RunnerInterface adapter. The package is substrate, not a one-line Laravel integration.
- How do I install symfony/runtime in a Laravel project?
- Run composer require symfony/runtime. It resolves cleanly with Laravel because symfony/http-foundation and symfony/http-kernel are already in the dependency tree. Installation alone does nothing for Laravel, though; you must wire a custom runtime and runner into public/index.php and handle Dotenv precedence. Pin the version and treat it as security-sensitive.
- Which Laravel and PHP versions are compatible with symfony/runtime?
- Laravel 11 or 12 paired with symfony/runtime ^7.x is coherent. symfony/runtime ^8.x requires PHP 8.4 or higher, which may constrain your fleet more than Laravel itself does. Runtime's supported matrix follows Symfony's release roadmap, not Laravel's, so check the PHP floor before upgrading.
- How much work is a custom Laravel runtime adapter?
- The surface area is small: a senior PHP engineer can build a working LaravelRuntime plus LaravelRunner in about a day. A production-grade version with tests is roughly one to two sprints. The adapter bridges Runtime's environment and Dotenv resolution to Laravel's bootstrap while keeping the two env pipelines from fighting.
- Is symfony/runtime a replacement for Laravel Octane?
- No. Octane is Laravel's first-party answer for RoadRunner, Swoole and FrankenPHP workers and owns the worker lifecycle. Runtime can auto-detect FrankenPHP worker mode, which creates two layers claiming ownership of the request loop. Treat them as overlapping, not interchangeable, and resolve request-loop ownership explicitly.
- Why does symfony/runtime cause dotenv or environment conflicts in Laravel?
- Runtime reads .env, APP_ENV and APP_DEBUG, and Laravel also loads .env and can bake environment values into config:cache. Two resolvers with different precedence rules can produce 'works locally, wrong DB in production' incidents. You need one documented precedence model and probably should disable one pipeline outside local development.
- Is symfony/runtime safe for production given its CVEs?
- It is security-sensitive code because it reads $_SERVER, argv and dotenv files on every request in an application's most privileged path. CVE-2024-50340 allowed argv-based environment injection on non-CLI SAPIs, and CVE-2026-46626 bypassed that patch until argv was gated on $_SERVER. Pin versions, maintain a prompt patch SLA and review it as security-critical code.
- How should I test a Laravel integration with symfony/runtime?
- Test the adapter contracts rather than the framework: assert that RuntimeInterface resolves the expected environment, APP_DEBUG and options, and that RunnerInterface returns the correct exit codes. Add integration tests for public/index.php under CLI and web SAPIs, plus tests proving .env and config:cache precedence. Include a regression test for argv handling on non-CLI SAPIs.
- Should I adopt symfony/runtime in a Laravel app, or are there alternatives?
- Adopt it only if you specifically need a runtime-agnostic front controller and are prepared to own the adapter. Laravel 11's bootstrap/app.php and Octane already cover much of the practical value with first-party Laravel support. Otherwise the adapter cost, double-dotenv risk and security surface usually outweigh the decoupling benefit.