Search code examples
phpsymfonytoolbarprofilerphp-7

Symfony Web Profiler not working


Yesterday my Web Profiler stopped working, in Symfony v.3.0.9 (on Win, with WAMP, PHP v7.0.4). Before that it worked just fine and I'm not sure exactly what happened when it stopped.

I first checked the JS errors being reported, then possible errors in dev.log, then tried clearing the cache (with cache:clear), also as an admin and also manually in file system. Nothing helped. There are no errors returned anywhere and there are no tries from client side to even call it with AJAX. I tried restarting Apache, Wamp & Windows.

Then, I tried composer update, which naturally brought up some new, unrelated issues, and eventually I ended up installing Symfony 3.1, but still no sign of Profiler.

My HTML page does have a body, so the solution here: Web Profiler not showing up in dev doesn't help me. All other mentions of this problem usually lead to some compiling issue, which I don't have (or didn't find it yet).

I also made sure I am running in dev mode, by putting breakpoints in app_dev.php directly.

Has anyone any other/new idea what could be going on?

Addition: I also tried updating Symfony to 3.2, without Profiler appearing.

Addition #2: Just wanted to share, that the only way I can get my Web Profiler to show is, after the cache is rebuilt, go into the var/cache/dev/appDevDebugProjectContainer.php, into the getProfilerService() function and manually comment out the line with:

$instance->disable();

Ugly as hell, but I haven't find any other solution until now. At least, now I see that somehow Symfony decides, based on some internal logic, to actually not show the profiler. At least there is some logic at works.


Solution

  • The final answer to my "mysterious" issue was that someone in the team changed the profiler's setting in the config_dev.yml, and set the:

    framework:
        profiler:
            collect: false
    

    Getting that back to collect:true (which is also its default value) made it all work.