Php 在未连接到远程主机的虚拟机(debian)上使用Xdebug进行调试

Php 在未连接到远程主机的虚拟机(debian)上使用Xdebug进行调试,php,linux,apache,xdebug,remote-debugging,Php,Linux,Apache,Xdebug,Remote Debugging,我的环境: 在Mac上,我运行的是一个Debian(jessie)虚拟机,带有Apache2.4.10、PHP5.6.9和Xdebug 2.3.3。 虚拟机在我的局域网中有自己的IP地址,我在Mac的主机文件中输入了主机名,因此可以通过主机名访问虚拟机中的网站;因此,我在Apache中配置了vhost 我想做什么: 我需要在远程服务器(VM)上调试我的PHP项目。所以我遵循了我在网上找到的一些说明。但不幸的是,Xdebug从未尝试连接到远程主机 更多事实: myphp.ini中的my[xdebu

我的环境:

在Mac上,我运行的是一个Debian(jessie)虚拟机,带有Apache2.4.10、PHP5.6.9和Xdebug 2.3.3。 虚拟机在我的局域网中有自己的IP地址,我在Mac的主机文件中输入了主机名,因此可以通过主机名访问虚拟机中的网站;因此,我在Apache中配置了vhost

我想做什么:

我需要在远程服务器(VM)上调试我的PHP项目。所以我遵循了我在网上找到的一些说明。但不幸的是,Xdebug从未尝试连接到远程主机

更多事实:

my
php.ini中的my
[xdebug]
部分:

[Xdebug]
; this is commented out, because i received warnings in apache's error.log, that it is allready activated somewhere else
; I found a site in the Web, where somebody says, that this means, the extension is already compiled into my php binary
; even with this line active I face the same behavior
;zend_extension = /usr/lib/php5/20131226/xdebug.so 
xdebug.remote_enabled = 1 
; this is comented out, because i activated remote_connect_back
;xdebug.remote_host = 192.168.2.106
xdebug.remote_mode = req
xdebug.remote_connect_back = 1 
xdebug.remote_autostart = 1 
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM 
xdebug.remote_log = /var/log/apache2/xdebug_log
php-i
输出的
xdebug
部分:

xdebug

xdebug support => enabled
Version => 2.3.3
IDE Key => root

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.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.halt_level => 0 => 0
xdebug.idekey => no value => no value
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
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_enable_trigger_value => no value => no value
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 => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => no value => no value
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_enable_trigger_value => no value => no value
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
因为我想用PHPStorm进行调试,但在我重新加载网站时它从未收到调试请求,所以我决定跟踪TCP通信。因此,在VM中,我调用了以下命令:

tcpdump -ni eth0 -n port 9000 -X
但不幸的是,我从未收到任何关于端口9000的数据包

此外,我在端口9000上使用netcat进行了测试:

netcat 192.168.2.106 9000
现在,tcpdump显示了从端口9000到客户端的大量包,如果PHPStorm没有侦听,netcat会告诉我连接被拒绝

所以(昨天)在谷歌上搜索了一整天之后,我无法确定我的问题。请任何人把我的鼻子指向正确的方向

我做错了什么

对不起,我的英语很差