2016-05-17 70 views
2

我在Mac上安裝了帶有brew的Php56。 隨着phpinfo()函數,我可以看到Xdebug的,甚至用php -m在PhpStorm和Brew中啓用Xdebug

[Zend Modules] 
Xdebug 

PHP --version

PHP 5.6.21 (cli) (built: Apr 29 2016 02:31:44) 
Copyright (c) 1997-2016 The PHP Group 
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies 
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans 

啓動服務器PHP和

php -S 127.0.0.1:8080 

而且使The icon with Phone但我的代碼不停在斷點處。

我嘗試修改甚至

/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini 

有:

zend_extension="/usr/local/opt/php56-xdebug/xdebug.so" 
xdebug.remote_autostart = 1 
xdebug.remote_enable = 1 

我甚至嘗試驗證調試器配置 enter image description here

我的Xdebug:

xdebug 

xdebug support => enabled 
Version => 2.4.0 
IDE Key => bob 

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 => On => On 
xdebug.profiler_enable_trigger => Off => Off 
xdebug.profiler_enable_trigger_value => no value => no value 
xdebug.profiler_output_dir => /var/tmp/ => /var/tmp/ 
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p 
xdebug.remote_addr_header => no value => no value 
xdebug.remote_autostart => On => On 
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 => 127.0.0.1 => 127.0.0.1 
xdebug.remote_log => no value => no value 
xdebug.remote_mode => req => req 
xdebug.remote_port => 9000 => 9000 
xdebug.scream => Off => Off 
xdebug.show_error_trace => 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 => /var/tmp/ => /var/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

在瀏覽器中,Xdebug和PhpStorm將查找名爲XDEBUG_SESSION的值爲PHPSTORM的cookie。

xdebug.remote_enable = 1 
xdebug.remote_connect_back=1 
#choose different port if nginx php-fpm used, because of nginx conf fastcgi_pass 127.0.0.1:9000;) 
xdebug.remote_port = 9000 
xdebug.idekey=PHPSTORM 

之後使用該xdebug helper(不要忘了管理擴展,並更改IDE密鑰選項)