1

I'm using Symfony 4.4 with PHP 7.4.7

The Symfony documentation indicates that cache:clear command will generate a "file called preload.php in the config/ directory" (see https://symfony.com/blog/new-in-symfony-4-4-preloading-symfony-applications-in-php-7-4#opcache-preloading-in-symfony). However, this is not the case.

In addition, the blog https://symfony.com/blog/new-in-symfony-4-4-preloading-symfony-applications-in-php-7-4#opcache-preloading-in-symfony tells us that the preload file is generated in /path/to/project/var/cache/<env>/

Is the official documentation deprecated or is there something I've not understood ?

So i don't really know how to use correctly this feature...

Thanks in advance for your answers.

IMSoP
  • 89,526
  • 13
  • 117
  • 169

1 Answers1

-1

Most possibly very late to the party, but I managed to find the solution for this issues. I can't find it in the 4.4 docs, but it's there in the 5.3 docs.

If this file is missing, run this command to reinstall the Symfony Flex recipe: composer recipes:install symfony/framework-bundle --force -v.

I've tried this and it creates the config/preload.php file, but it also changes these files, too:

modified:   .env
modified:   .gitignore
modified:   config/packages/framework.yaml
modified:   config/services.yaml
modified:   public/index.php
modified:   symfony.lock

Depending on what you have in .gitignore, you might see a lot of changes. Make sure they are relevant and are not breaking your application.

Vlad Dumitrache
  • 301
  • 4
  • 13