douzhi9939 2015-04-02 11:43
浏览 58

Symfony允许内存大小的字节耗尽WebProfilerBundle Twig呈现为服务

Since I migrated my Symfony 2.1 I'm having a problem with the WebProfilerBundle. The profiler bar is shown, but when I click on a link it will show a blank page. In the PHP error file the following error is shown.

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4194304 bytes) in C:\Work\Projects\DirectpayLogin\solution\vendor\symfony\symfony\src\Symfony\Component\Stopwatch\StopwatchEvent.php on line 102

The error location is random. So not always StopwatchEvent.php.

I've narrowed down the problem to this file: \vendor\symfony\symfony\src\Symfony\Bundle\WebProfilerBundle\Resources\views\Profiler\layout.html.twig

In this template the twig render service functions are causing the problem. If I replace the render service with render controller is does work.

So I'm replacing this line: {{ render(path('_wdt', { 'token': token, 'position': 'normal' })) }} With this line: {% render controller('web_profiler.controller.profiler:toolbarAction',{ 'token': token, 'position': 'normal' }) %}

So it seems my Symfony has a problem with rendering controllers as a service. But why? The problem started from version 2.2 and I'm now running 2.7.

Setting my php.ini memory_limit to -1 will still give this error. It will only take longer. It seems to be a loop of some kind.

PHP version is 5.6 and my dev pc runs windows 7 and iis 7

I really hope someone can help me with this.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 matlab中使用gurobi时报错
    • ¥15 WPF 大屏看板表格背景图片设置
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂