Skip to content

Conversation

@mudassaralichouhan
Copy link

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #61491
License MIT

This PR adds support for displaying the APP_RUNTIME value in the Symfony Profiler configuration dashboard.

Before

  • The configuration dashboard did not show which application runtime was used.

After

  • A new section "Application Runtime" is displayed when $_SERVER['APP_RUNTIME'] is set, making it easier to debug and confirm the active runtime.
$_SERVER['APP_RUNTIME'] = 'Symfony\\Runtime\\SymfonyRuntime';

Profiler UI

Application Runtime
-------------------
Runtime: Symfony\Runtime\SymfonyRuntime

@carsonbot carsonbot added this to the 7.4 milestone Aug 23, 2025
@carsonbot carsonbot changed the title feature: Add APP_RUNTIME display in Symfony Profiler configuration da… feature: Add APP_RUNTIME display in Symfony Profiler configuration da… Aug 23, 2025
@carsonbot carsonbot changed the title feature: Add APP_RUNTIME display in Symfony Profiler configuration da… [WebProfilerBundle] feature: Add APP_RUNTIME display in Symfony Profiler configuration da… Aug 24, 2025
@OskarStark OskarStark changed the title [WebProfilerBundle] feature: Add APP_RUNTIME display in Symfony Profiler configuration da… [WebProfilerBundle] Show APP_RUNTIME Aug 24, 2025
@MatTheCat
Copy link
Contributor

If APP_RUNTIME is not defined the runtime class will be the one defined in composer.json’s extra.runtime.class, or the SymfonyRuntime by default.

If the goal of this PR is only to display APP_RUNTIME’s value, the profiler already has a Server Parameters tab in the Request panel.

@OskarStark OskarStark changed the title [WebProfilerBundle] Show APP_RUNTIME [WebProfilerBundle] Show APP_RUNTIME Aug 24, 2025
@94noni
Copy link
Contributor

94noni commented Aug 24, 2025

Hey thx for trying that
Indeed this env var alone is not worth it
My main idea in the issue was if we can display, in the profiler or perhaps also the console about command, the real runtime behind the scene from wherever it can come from
(Dont know the feasability thought)

- Resolve runtime from APP_RUNTIME, composer.json extra.runtime.class, or Symfony\Runtime\SymfonyRuntime
- Expose via ConfigDataCollector::getAppRuntime and render in config.html.twig
- Add tests for env/composer/fallback resolution
@mudassaralichouhan
Copy link
Author

The PR now displays the resolved runtime class — it checks APP_RUNTIME, then composer.json's extra.runtime.class, and finally falls back to Symfony\Runtime\SymfonyRuntime if none are set. So it shows the actual runtime behind the scenes, not just the env var.

- Remove static cache from resolveAppRuntime() to avoid cross-test contamination
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Aug 27, 2025

About the implementation, this relies too much on implementation details.
A better implementation my be to rely on the global $runtime variable.

BUT, I'm not sure what this info could be useful for. Any details about that?

The runner might be a more useful thing to show, because then one can see if they're running frankenphp or etc.
And this can be known by checking the first frames of any stack trace.

@94noni
Copy link
Contributor

94noni commented Aug 27, 2025

@nicolas-grekas ftr, when I created the issue I was testing locally frankenphp with worker mode, and wanted to check if the runtime was the proper one, and didnt saw any thing related in profiler, thus opening this issue

@nicolas-grekas
Copy link
Member

OK, so showing the runtime won't help. The SymfonyRuntime is able to handle both PHP-FPM and frankenphp.

@nicolas-grekas
Copy link
Member

Closing for history. PR welcome I suppose to show the runner instead.
Thanks for submitting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Profiler] RFC: display app runtime in the Symfony configuration dashboard

6 participants