0

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

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

    Resource interpreted as Image but transferred with MIME type text/html

  • CSS 和 JS 相同:

    net::ERR_CONNECTION_RESET

而且我无法清除缓存php app/console cache:clear -e prod

使用 debug true 清除 prod 环境的缓存
PHP 致命错误:C:\wamp\www\sylius\app\cache\pro_\twig\9a\2e\9cb2d88c764cb674efaa179d7259f64ff3b6396785924a758ca5728914b5.php 中允许的内存大小为 134217728 字节(尝试分配 98304 字节)已用尽

PHP堆栈跟踪:
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

致命错误:C:\wamp\www\sylius\app\cache\pro_\twig\9a\2e\9cb2d88c764cb674efaa179d7259f64ff3b6396785924a758ca5728914b5.php 中允许的内存大小为 134217728 字节已用尽(尝试分配 98304 字节)在线

调用堆栈:
    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

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

4

1 回答 1

0

试试这个:“#!/user/local/bin/php app/console cache:clear --env=prod”

答案基于 symfony 文档:

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

于 2019-05-21T09:47:35.013 回答