Skip to content
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

OPCache preloading issues #7205

Open
richardhj opened this issue May 10, 2024 · 1 comment
Open

OPCache preloading issues #7205

richardhj opened this issue May 10, 2024 · 1 comment

Comments

@richardhj
Copy link
Member

Affected version(s)

5.3.8

Description

When using OPCache preloading, I get the following error:

PHP Warning:  Can't preload unlinked class Contao\Template@anonymous: Unknown trait Contao\BackendTemplateTrait in /app/vendor/contao/core-bundle/src/Twig/Extension/ContaoExtension.php on line 355

Details on the error: https://stitcher.io/blog/preloading-in-php-74#warning:-can't-preload-unlinked-class

In order for files to be preloaded, their dependencies — interfaces, traits and parent classes — must also be preloaded.

How to enable preloading:

opcache.preload = /var/cache/prod/Shared_KernelProdContainer.preload.php;
@m-vo
Copy link
Member

m-vo commented May 11, 2024

This is only needed for rendering legacy templates from within Twig, thus needing the legacy framework.

Why isn't the rest of the legacy framework an issue with preloading?

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

2 participants