Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
XAMPP WordPress PHP VSCode Xdebug无本地变量_Php_Wordpress_Visual Studio Code_Xampp_Xdebug - Fatal编程技术网

XAMPP WordPress PHP VSCode Xdebug无本地变量

XAMPP WordPress PHP VSCode Xdebug无本地变量,php,wordpress,visual-studio-code,xampp,xdebug,Php,Wordpress,Visual Studio Code,Xampp,Xdebug,我将WordPress与本地XAMPP服务器一起使用 为了调试我的PHP代码,我使用了Xdebug和VisualStudio代码,但它并没有像我期望的那样工作。当我在第191行停止执行并转到第194行时,我希望在左上角的变量->局部变量处看到两个局部变量$html和$rmcounter的值,但是没有任何值 当我继续执行步骤,直到我离开rm_deug_test()函数时,我看到shortcodes.php,然后一切正常。我在左上角看到局部变量,我可以将鼠标悬停在上面,例如,$tag,我可以看到这

我将WordPress与本地XAMPP服务器一起使用

为了调试我的PHP代码,我使用了Xdebug和VisualStudio代码,但它并没有像我期望的那样工作。当我在第191行停止执行并转到第194行时,我希望在左上角的
变量->局部变量处看到两个局部变量
$html
$rmcounter
的值,但是没有任何值

当我继续执行步骤,直到我离开
rm_deug_test()
函数时,我看到
shortcodes.php
,然后一切正常。我在左上角看到局部变量,我可以将鼠标悬停在上面,例如,
$tag
,我可以看到这个变量的值


我应该怎么做才能看到我的
rm_debug\u test()
函数的变量值?

与此同时,我发现了一个解决方案,其他程序员可能会对使用wordpress xampp xdebug php和visual studio代码感兴趣:我更改了xampp/php文件夹中的php.ini文件。我只需要禁用opcache。我将opcache.enable=1更改为opcache.enable=0。现在,在我赋值时,visual studio代码调试会在创建所有局部变量后立即显示它们。

本网站更多的是关于编程语言的问题,而不是关于不同的文本编辑器或IDE如何工作的问题,因此如果您没有立即得到答案,请不要感到惊讶。对于VisualStudio论坛或常见问题解答,您可能会更幸运