我已经转移到一个新的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
非常感谢所有帮助。
答案 0 :(得分:0)
正如@ÁlvaroG。Vicario注意到我的xdebug.ini中有错误的引号,我根本没有注意到,因为我认为我将它复制出了以前的xdebug.ini。