【发布时间】:2014-03-11 13:20:35
【问题描述】:
我已经转移到一个新的 VPS(这个 vps 将只运行一个站点)并且无法使用 netbeans 连接到我的项目以对其进行调试,并且我收到了令人愤怒的“等待连接”消息。我的想法不多了。以下是我为正在运行的 ubuntu 12.04 LTS 服务器所采取的步骤。它也运行 plesk。
所以我用 apt-get 安装了 xdebug 然后我将我的 phpinfo 放入 xdebug wizard 并升级到 2.2.4 我验证了 xdebug 已正确安装并重新启动了 apache,在我的 phpinfo 中我可以在那里看到 xdebug。 我在 xdebug.ini 中设置了以下内容
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_mode = “req”
xdebug.remote_handler = dbgp
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.idekey = “netbeans-xdebug”
xdebug.remote_log = "/tmp/new_xdebug_remote.log"
我还用 ufw 打开了 9000 端口,这是输出
Status: active
To Action From
-- ------ ----
[ 1] 443 ALLOW IN Anywhere
[ 2] 80 ALLOW IN Anywhere
[ 3] 22 ALLOW IN Anywhere
[ 4] 9000/tcp ALLOW IN Anywhere
[ 5] 443 ALLOW IN Anywhere (v6)
[ 6] 80 ALLOW IN Anywhere (v6)
[ 7] 22 ALLOW IN Anywhere (v6)
[ 8] 9000/tcp ALLOW IN Anywhere (v6)
注意:我也尝试过仅使用 9000 而不是 9000/tcp
我的 netbeans 设置正确,因为测试连接良好,除了 ip 地址之外,它与我之前对我之前的 AWS ec2 实例的设置相同。
端口转发正在工作,因为我使用 AWS 设置对其进行了测试,这是一种享受。我需要调试这个新的 VPS,因为我在这里看到了一个在 AWS 上没有看到的问题,这是一个真正的问题。
xdebug 日志未按应有的方式在 /tmp 目录中生成。这向我暗示 xdebug 永远不会启动,因为它没有收到请求。
以下是我的 xdebug 设置,以防需要:
xdebug support enabled
Version 2.2.4
IDE Key “netbeans-xdebug”
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 “netbeans-xdebug” “netbeans-xdebug”
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 On On
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 /tmp/new_xdebug_remote.log /tmp/new_xdebug_remote.log
xdebug.remote_mode “req” “req”
xdebug.remote_port 9000 9000
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
非常感谢所有帮助。
【问题讨论】:
-
这些智能引号(“req”)真的存在吗?
-
可能在我复制和粘贴时。看起来与文件中的普通引号相同,因为我直接从以前的 xdebug.ini 中复制了它们
-
F**K OFF 我刚试过,你是对的!根本没有注意到那些!您先生是一位鹰眼传奇