title: 404 on _wdt: Symfony WebProfiler doesn't generate any profile data
body: <p>Symfony2 fires lots of 404 in developer-mode when i want to enable the web profiler toolbar:</p>
  <pre><code>GET http://www.domain.dev/_wdt/de040c 404 (Not Found)
  </code></pre>
  <p>So i debugged the ProfilerController and discovered that it fires 404 when there is no profile-data found in filesystem.</p>
  <p>But with every request to the page there will be new directories created under the directory &quot;app/cache/dev/profiler&quot;, but still no files.</p>
  <p>The file tree under app/cache/dev looks like:</p>
  <p><a href="https://i.stack.imgur.com/depxM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/depxM.png" alt="enter image description here" /></a></p>
  <p>As you can see, the directory &quot;profiler&quot; contains some directories (and it will be growing with every request to the site), but never any files. There are full write permissions for the nginx and php process, i also configured the cache-directory as an example to use shared memory under /dev/shm to prevent side effects with my host-system (i'm using vagrant for development)</p>
  <p>So my question is: why are there no profiler data created, and &quot;who&quot; will be responsible for that?</p>
  <h3>UPDATE:</h3>
  <p>i found out, that in FileProfileStorage.php all profile data will be collected and serialized:</p>
  <pre><code>// Store profile
  $data = array(
      'token' =&gt; $profile-&gt;getToken(),
      'parent' =&gt; $profile-&gt;getParentToken(),
      'children' =&gt; array_map(function ($p) { return $p-&gt;getToken(); }, $profile-&gt;getChildren()),
      'data' =&gt; $profile-&gt;getCollectors(),
      'ip' =&gt; $profile-&gt;getIp(),
      'method' =&gt; $profile-&gt;getMethod(),
      'url' =&gt; $profile-&gt;getUrl(),
      'time' =&gt; $profile-&gt;getTime(),
  );
  
  if (false === file_put_contents($file, serialize($data))) {
      return false;
  }
  </code></pre>
  <p>Here an exception will be thrown &quot;Serialization of Closure is not allowed&quot;. I still haven't found out which DataCollector will be responsible for using a Closure instead of &quot;real&quot; data.</p>
  <h3>UPDATE 2:</h3>
  <p>i figured out that the ProfilerExtension of TwigCacheBundle will throw exception here (&quot;Serialization of Closures is not supported&quot;)</p>