提问者:小点点

Sylius缓存管理


当我开始使用Sylius时,我没有意识到它还不稳定,我完全定制了开发版本,而不是启动一个新项目。现在,由于缓存管理,我认为我无法将其放入prod中:

>

  • 图像不总是加载,但有时:

    资源解释为图像,但传输与MIME类型文本/html

    CSS和JS也一样:

    net::错误连接\u重置

    我无法使用php应用程序/控制台缓存:clear-e prod清除缓存:

    Clearing the cache for the prod environment with debug true
    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 98304 bytes) in C:\wamp\www\sylius\app\cache\pro_\twig\9a\2e\9cb2d88c764cb674efaa179d7259f64ff3b6396785924a758ca5728914b5.php on line 98
    
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\www\sylius\app\console:0
    PHP   2. Symfony\Component\Console\Application->run() C:\wamp\www\sylius\app\console:28
    PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:121
    PHP   4. Symfony\Component\Console\Application->doRun() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:96
    PHP   5. Symfony\Component\Console\Application->doRunCommand() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:191
    PHP   6. Symfony\Component\Console\Command\Command->run() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:905
    PHP   7. Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:244
    PHP   8. Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php:83
    PHP   9. Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php:120
    PHP  10. Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer->warmUp() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate.php:47
    PHP  11. Twig_Environment->loadTemplate() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer.php:62
    
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 98304 bytes) in C:\wamp\www\sylius\app\cache\pro_\twig\9a\2e\9cb2d88c764cb674efaa179d7259f64ff3b6396785924a758ca5728914b5.php on line 98
    
    Call Stack:
        0.0005     331032   1. {main}() C:\wamp\www\sylius\app\console:0
        0.0698    3608112   2. Symfony\Component\Console\Application->run() C:\wamp\www\sylius\app\console:28
        0.0764    3860448   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:121
        0.6014   15730344   4. Symfony\Component\Console\Application->doRun() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:96
        0.6027   15730344   5. Symfony\Component\Console\Application->doRunCommand() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:191
        0.6034   15755448   6. Symfony\Component\Console\Command\Command->run() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:905
        0.6037   15755792   7. Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:244
        0.7519   16165176   8. Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php:83
        7.0263   57502064   9. Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php:120
       14.6093   95010368  10. Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer->warmUp() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate.php:47
       21.6284  133900880  11. Twig_Environment->loadTemplate() C:\wamp\www\sylius\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer.php:62

    编辑:我已经手动清除了缓存,但它没有改变任何东西。


  • 共1个答案

    匿名用户

    试试这个:“#!/user/local/bin/php应用/控制台缓存:清除--env=prod"

    答案基于symfony文件:

    https://symfony.com/doc/2.8/console/usage.html