Skip to content

[Runtime] Deprecation errors are displayed when cache is cold #60528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bartosz-zasada opened this issue May 24, 2025 · 2 comments
Closed

[Runtime] Deprecation errors are displayed when cache is cold #60528

bartosz-zasada opened this issue May 24, 2025 · 2 comments

Comments

@bartosz-zasada
Copy link

Symfony version(s) affected

7.2.6

Description

When a deprecation error is raised while hitting any page, and the cache has just been cleared, the error is displayed directly on the screen, rather than just being logged. This may result in the red exception page with the "headers already sent" error if the page in question uses session.

How to reproduce

  1. Create a new Symfony project with the Symfony CLI tool using PHP version 8.4: symfony new --webapp my_project
  2. Install a package that triggers deprecation errors on PHP 8.4, for example winzou/state-machine-bundle: composer require winzou/state-machine-bundle:0.6.2
  3. Remove the cache and start the server: rm -rf var/cache/*, symfony serve

Possible Solution

No response

Additional Context

No response

@valtzu
Copy link
Contributor

valtzu commented May 24, 2025

This is an opcache-related issue in PHP 8.4. You can verify this by temporarily disabling opcache in your PHP configuration.

See php/php-src#17422 / php/php-src#18541

@nicolas-grekas
Copy link
Member

Thanks for the links @valtzu

This makes me quite sad: silencing deprecations means nobody will see them so better not, and displaying them breaks the output. And there's no possible workaround.

I'm closing because there's nothing we can do directly about this.

This might still be a bit related to #58847 and #35575, where ppl ask for more control over the way php errors are configured.

Thanks for the report @bartosz-zasada

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

No branches or pull requests

5 participants