2015-11-17 84 views
0

不知道我做了什麼來破解它,但是當運行CLI腳本(如Laravel命令)時,Xdebug不再在我的流浪漢上工作。仍然適用於網絡請求。Xdebug在流浪PHPstorm上的CLI腳本斷點上不停止

這裏是/etc/php5/cli/conf.d/20-xdebug.ini內容:

zend_extension=xdebug.so 
xdebug.var_display_max_data = -1 
xdebug.var_display_max_depth = 10 
xdebug.default_enable = 1 
xdebug.remote_enable = 1 
xdebug.remote_connect_back = 1 
xdebug.remote_port = 9001 
xdebug.remote_autostart = 1 
xdebug.remote_handler = dbgp 
xdebug.idekey = PHPSTORM 
xdebug.collect_return = 1 
xdebug.collect_params = 10 
xdebug.show_mem_delta = 1 
xdebug.profiler_enable_trigger = 1 
xdebug.profiler_output_dir = "/home/vagrant/Projects/xdebug_profiler" 
xdebug.trace_enable_trigger = 1 
xdebug.trace_output_dir = "/home/vagrant/Projects/xdebug_traces" 
xdebug.profiler_enable = 0 
xdebug.trace_enable = 1 
xdebug.cli_color = 1 

PHPStorm在項目的喜好配置端口9001上Xdebug的。 (端口9000 HHVM衝突甚至儘管我沒有運行HHVM)

enter image description here

我也有IDE鍵設置爲「PHPSTORM」爲「PHP遠程調試」的配置爲我的流浪者開發主機。

enter image description here

絕對路徑也被設定爲在PHPStorm該服務器。

enter image description here

點擊收聽,然後調試圖標打開調試選項卡,但它永遠不會停止在任何斷點。的phpinfo()

enter image description here

CLI輸出給我上的Xdebug此信息:

xdebug support => enabled 
Version => 2.3.2 
IDE Key => PHPSTORM 

Supported protocols => Revision 
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $ 

Directive => Local Value => Master Value 
xdebug.auto_trace => Off => Off 
xdebug.cli_color => 1 => 1 
xdebug.collect_assignments => Off => Off 
xdebug.collect_includes => On => On 
xdebug.collect_params => 10 => 10 
xdebug.collect_return => On => On 
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 => PHPSTORM => PHPSTORM 
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 => On => On 
xdebug.profiler_enable_trigger_value => no value => no value 
xdebug.profiler_output_dir => /home/vagrant/Projects/xdebug_profiler => /home/vagrant/Projects/xdebug_profiler 
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p 
xdebug.remote_autostart => On => On 
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 => no value => no value 
xdebug.remote_mode => req => req 
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 => On => On 
xdebug.trace_enable_trigger => On => On 
xdebug.trace_enable_trigger_value => no value => no value 
xdebug.trace_format => 0 => 0 
xdebug.trace_options => 0 => 0 
xdebug.trace_output_dir => /home/vagrant/Projects/xdebug_traces => /home/vagrant/Projects/xdebug_traces 
xdebug.trace_output_name => trace.%c => trace.%c 
xdebug.var_display_max_children => 128 => 128 
xdebug.var_display_max_data => -1 => -1 
xdebug.var_display_max_depth => 10 => 10 

這裏是xdebug.remote_log輸出:

Log opened at 2015-11-18 03:34:23 
I: Checking remote connect back address. 
W: Remote address not found, connecting to configured address/port: localhost:9001. :-| 
E: Could not connect to client. :-(
Log closed at 2015-11-18 03:34:23 

這是Ubuntu的14稍微改裝成宅基地運行在Mac OS 10.11.1下的PHPStorm 9.0.2下的流浪盒。

這裏有什麼東西看起來不合常理來解釋故障?

+0

** 1)**請提供xdebug日誌('xdebug.remote_log')。到目前爲止,它最有可能的作用......但連接到本地9001端口而不是遠程(您的PC)。 ** 2)**因爲您想在瀏覽器中調試腳本(基於您在PhpStorm中的運行/調試配置;對嗎?),那麼您應該通過瀏覽器捕獲'phpinfo()'輸出。如果您打算調試實際的CLI腳本(在CLI環境中啓動並執行 - 例如在終端中),則此配置不完整。 – LazyOne

+0

所以 - xdebug先登錄。之後,我們可以看看3)如果這些端口在實際的流量中被映射/打開(可以建立傳出連接); 4)也許這是你的本地防火牆。 – LazyOne

+0

Web Xdebug連接已經起作用。只有CLI連接被破壞。用'remote_log'值更新了問題。 – eComEvo

回答

0

修復了這個問題,當我意識到另一個在xdebug配置中使用xdebug.remote_host = 192.168.56.1的流浪盒通過CLI連接時。 VagrantFile的值爲ip: "192.168.56.101"

這導致我發現使用相同類型IP約定的post on walkah.net

考慮到這一點,我從我的流浪盒上的VagrantFile中獲取了值爲ip: "192.168.10.10"的值,Xdebug無法從CLI連接,並將其更改爲在設置xdebug.remote_host = 192.168.10.1中使用。

我現在可以再次使用PHPStorm從該流浪盒中調試斷點。 :)