netbeans中的php-xdebug如何查看变量的值?

2024-04-29 20:11:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我在php.ini文件中启用了xdebug,如下所示:

[XDebug]
zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.trace_output_dir = "D:\xampp\tmp"

我的netbeans设置和他们的手册一样。现在,当我尝试Ctrl+F5(在第140行中设置断点之后),它显示如下:

breakpoint setted in line 140

我如何在下面的netbean控制台中查看$user_id的值(或任何其他变量的值)??在

或者是否有任何方法可以通过在CLI中设置断点和检查变量值来调试PHP代码,比如pythonimport pdb;pdb.set_trace()???这样代码会在特定的行中中断(当执行诸如提交表单或重新加载浏览器之类的操作时),然后我可以在断点之前甚至在断点后continue检查每个变量


Tags: 文件代码outputremoteenabledirtraceini
1条回答
网友
1楼 · 发布于 2024-04-29 20:11:54

1.回顾ini.php文件配置。在

xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000

还要确保zend_extension=“D:\xampp\php\ext\php”_xdebug.dll“是正确的。在我的电脑上我有/而不是\,不知道这是否重要。。。在

2.重新启动服务器(不确定是否需要)。在

3.在“工具”->“选项”->“PHP”->“调试”中检查netbeans配置

4.检查项目属性:“浏览器”和“运行配置”

如果一切正常,您可以在netbeans和laung debug中设置断点:“debug”->;“debug project”

相关问题 更多 >