Rej*_*lam 7 php python debugging netbeans xdebug
我xdebug
在php.ini
文件中启用如下:
[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"
Run Code Online (Sandbox Code Playgroud)
我的netbeans设置与他们的手册相同.现在,当我尝试Ctrl + F5(在第140行设置断点之后)时,它显示如下:
如何$user_id
在netbean的控制台下面看到(或任何其他变量的值)的值?
或者是否有任何方法可以通过在CLI中设置断点和检查变量值来调试PHP代码,如python import pdb;pdb.set_trace()
??? 以便代码在特定行中断(当采取像提交表单或重新加载浏览器一样的操作)然后我可以在断点之前甚至continue
在断点之后检查每个变量
1.检查您的 php.ini 配置。
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000
Run Code Online (Sandbox Code Playgroud)
还要确保您的 zend_extension = "D:\xampp\php\ext\php_xdebug.dll" 是正确的。在我的电脑上我有 / 而不是 \,不确定这是否重要......
2.重新启动服务器(不确定是否需要)。
3.在工具->选项->PHP->调试中检查你的netbeans配置
4.检查项目属性:“浏览器”和“运行配置”
如果一切正确,您可以在 netbeans 中设置断点并启动调试:“调试”->“调试项目”
归档时间: |
|
查看次数: |
634 次 |
最近记录: |