简体   繁体   English

DebugKit CakePHP 3.x ReferenceError:未定义__debug_kit_id

[英]DebugKit CakePHP 3.x ReferenceError: __debug_kit_id is not defined

I recently upgraded php from 5.6 to 7 and I think it broke CakePHP's DebugKit. 我最近将php从5.6升级到了7,我认为它破坏了CakePHP的DebugKit。 On every page I navigate to within my app, the debug_kit javascript file produces an error, specifically when setting the currentRequest. 在我浏览至应用程序的每个页面上,debug_kit javascript文件都会产生错误,特别是在设置currentRequest时。 The error is: 错误是:

ReferenceError: __debug_kit_id is not defined ReferenceError:__debug_kit_id未定义

At first I didn't install sqlite, so I thought that was the issue, but after installing the sqlite, mbstring, and intl extensions the error is still there. 起初我没有安装sqlite,所以我认为这是问题所在,但是在安装了sqlite,mbstring和intl扩展名之后,错误仍然存​​在。 I can't seem to find an answer anywhere, most of the problems people encounter with debugkit seem to be solved by installing sqlite. 我似乎在任何地方都找不到答案,人们使用debugkit遇到的大多数问题似乎都可以通过安装sqlite来解决。

The code snippet from the debug_kit.js file: debug_kit.js文件中的代码片段:

$(document).ready(function() {
    toolbar = new Toolbar({
    button: $('#toolbar'),
    content: $('#panel-content-container'),
    panelButtons: $('.panel'),
    panelClose: $('#panel-close'),
    keyboardScope : $(document),
    currentRequest: __debug_kit_id,
    originalRequest: __debug_kit_id,
    baseUrl: __debug_kit_base_url
});

toolbar.initialize();

Thanks everyone! 感谢大家!

This not appear to be a PHP error, but rather a Javascript one because the variable __debug_kit_id is not defined anywhere in your Javascript code. 这似乎不是PHP错误,而是Javascript错误,因为变量__debug_kit_id没有在Javascript代码的任何位置定义。 Define it to be something like 将其定义为类似

var __debug_kit_id = 0;

or whatever value it should have and that will solve your error. 或应该具有的任何值,这将解决您的错误。

I was able to solve my own problem by removing all remaining php5 packages. 我能够通过删除所有剩余的php5软件包来解决自己的问题。 I followed bento's answer from this askubuntu question: https://askubuntu.com/questions/59886/how-to-compelety-remove-php and going one by one through the old php5 packages (leaving php7 packages intact). 我遵循了来自bentobuntu问题的便当的答案: https ://askubuntu.com/questions/59886/how-to-compelety-remove-php,然后逐一浏览旧的php5软件包(完整保留了php7软件包)。 Thanks all 谢谢大家

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM