Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 404 on_wdt:Symfony WebProfiler不';不生成任何配置文件数据_Php_Symfony_Nginx_Profiler - Fatal编程技术网

Php 404 on_wdt:Symfony WebProfiler不';不生成任何配置文件数据

Php 404 on_wdt:Symfony WebProfiler不';不生成任何配置文件数据,php,symfony,nginx,profiler,Php,Symfony,Nginx,Profiler,当我想启用web profiler工具栏时,Symfony2在开发人员模式下激发了大量404: GET http://www.domain.dev/_wdt/de040c 404 (Not Found) 所以我调试了ProfilerController,发现它在文件系统中找不到配置文件数据时触发404 但每次请求页面时,都会在“app/cache/dev/profiler”目录下创建新目录,但仍然没有文件 app/cache/dev下的文件树如下所示: 正如您所看到的,目录“profiler

当我想启用web profiler工具栏时,Symfony2在开发人员模式下激发了大量404:

GET http://www.domain.dev/_wdt/de040c 404 (Not Found)
所以我调试了ProfilerController,发现它在文件系统中找不到配置文件数据时触发404

但每次请求页面时,都会在“app/cache/dev/profiler”目录下创建新目录,但仍然没有文件

app/cache/dev下的文件树如下所示:

正如您所看到的,目录“profiler”包含一些目录(它将随着对站点的每个请求而增长),但从不包含任何文件。nginx和php进程有完全的写权限,我还以缓存目录为例配置了/dev/shm下的共享内存,以防止主机系统的副作用(我使用vagrant进行开发)

所以我的问题是:为什么没有创建探查器数据,以及“谁”将对此负责

更新: 我发现,在FileProfileStorage.php中,所有配置文件数据都将被收集并序列化:

// Store profile
$data = array(
    'token' => $profile->getToken(),
    'parent' => $profile->getParentToken(),
    'children' => array_map(function ($p) { return $p->getToken(); }, $profile->getChildren()),
    'data' => $profile->getCollectors(),
    'ip' => $profile->getIp(),
    'method' => $profile->getMethod(),
    'url' => $profile->getUrl(),
    'time' => $profile->getTime(),
);

if (false === file_put_contents($file, serialize($data))) {
    return false;
}
这里将抛出一个异常“不允许闭包序列化”。我还没有发现哪个DataCollector将负责使用闭包而不是“真实”数据

更新2:
我发现TwigCacheBundle的ProfileXtension会在这里抛出异常(“不支持闭包序列化”)

我自己解决了这个问题。TwigCacheBundle的ProfileXtension在为Web探查器序列化其数据时引发异常

我犯了一个错误