【发布时间】:2014-05-01 23:09:34
【问题描述】:
我知道这个问题已经被无数次问过了,因为我浏览了论坛并阅读了很多这样的帖子。然而,这里的失败似乎是基于太多的变量,以至于解决方案是针对问题的,没有什么能真正解决我的问题。我觉得我需要你们所有更有经验的玩家的指导。
发生了什么:
在 NetBeans 中:
-
加载我的本地沙盒项目后,单击“调试项目”,在 Chrome 中打开 index.php 页面,代码一直运行到最后,无论断点如何,NetBeans 挂起并显示“等待连接 (xdebug)”。 ..
在上述过程中,我可以看到:
aaron@aaron-aspire-v5:/var/log/apache2$ netstat -an | grep 9001tcp6 0 0 :::9001 :::* LISTEN
在 Vim 中:
- 我在 Chrome 中加载
://localhost/html/sandbox/index.php?XDEBUG_SESSION_START=netbeans-xdebug - 我在 vim 中加载相同的文件
- 我按 F5,看到消息
waiting for a new connection on port 9001 for 10 seconds...so far so good。 - 我在网络浏览器中重新加载页面,没有任何反应
-
vim 连接超时
在上述期间,在超时之前,我可以看到:
aaron@aaron-aspire-v5:/var/log/apache2$ netstat -an | grep 9001tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN
我有什么:
- 运行 Ubuntu 13.10
- 运行 Apache 2.4.6
- Xdebug 是通过 pecl 安装的
-
我已经编辑了 /etc/php5/cli/php.ini 和 /etc/php5/apache2/php.ini 文件并添加了以下内容:
zend_extension=/usr/lib/php5/20121212/xdebug.so xdebug.default_enable=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=rep xdebug.remote_host=localhost xdebug.remote_port=9001 xdebug.remote_log=/var/log/apache2/xdebug.log
phpinfo() 现在返回有关 xdebug 的以下内容:
xdebug
xdebug support => enabled
Version => 2.2.5
IDE Key => aaron
Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $
Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.idekey => no value => no value
xdebug.max_nesting_level => 100 => 100
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => /var/log/apache2/xdebug.log => /var/log/apache2/xdebug.log
xdebug.remote_mode => rep => rep
xdebug.remote_port => 9001 => 9001
xdebug.scream => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
- 对于 NetBeans 7.4:在工具 => 选项 => 常规下,我使用的是“无代理”;测试连接返回成功;在工具 => 选项 => PHP => 调试下,我有调试器端口:9001,会话 ID:netbeans-xdebug,最大数据长度:2048,在第一行停止:真,未选中所有其他选项。
- 对于 debugger.vim v1.0.2(和 debugger.py):debugger.vim 和 debugger.py 都添加到我的 /usr/share/vim/vim74/plugins 文件夹中,
let g:debuggerPort = 9001已添加到我的 . vimrc 文件,php_value xdebug.remote_port 9001已添加到我的 apache2.conf 文件中。
非常感谢任何帮助!提前谢谢你。
【问题讨论】:
标签: php apache debugging netbeans xdebug