2010-01-04 109 views
2

我現在已經嘗試了幾個小時,讓xDebug(從源代碼編譯爲2.0.5)在使用NetBeans 6.8的MacBook OS X上工作。我已經安裝了MAMP,並且正在運行一個小型的PHP(5.2)測試程序,沒問題。但是當我嘗試調試時,我在Netbeans中得到了這個文本:「等待連接(netbeans-xdebug)」並且沒有更多事情發生。 Netbeans被配置爲調試器端口9000.在MAMP中沒有Zend優化。xDebug似乎確定已安裝,但未與NetBeans連接

我都遵循這樣的:http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html#installEnableXdebughttp://www.xdebug.org/docs/installhttp://forums.netbeans.org/topic1513-0-asc-0.html

這裏是我的php.ini的一部分

[XDebug] 

;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" 

;[Zend] 

;zend_optimizer.optimization_level=15 

;zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.9 

;zend_optimizer.version=3.3.9 

; Xdebug config for Mac OS X and NetBeans IDE 

zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so 

xdebug.remote_enable=1 

xdebug.remote_handler=dbgp 

xdebug.remote_mode=req 

xdebug.remote_host=localhost 

xdebug.remote_port=9000 

xdebug.idekey="netbeans-xdebug" 

我也讀了不少的安裝說明等,並的phpinfo表明了XDebug按照V.5.2.11安裝好(通過MAMP中的「打開開始頁面」)。但是,當我嘗試在終端PHP-m我沒有看到xdebug列出。我終於認爲PHP.INI是從/ etc讀取的,所以我將MAMP php.ini複製到php.ini中,從而在那裏添加了xdebug.se,localhost,port 9000等信息。之後,當我執行PHP -m時,列出了xdebug IS,但我仍然遇到NetBeans問題。奇怪的PHP -i顯示版本5.2.10,而不是上面的5.2.11!

我也試過這個,添加 「於NetBeans XDebug的」 爲idekey:Why does xdebug not establish connection with NetBeans?

爲什麼PHP_INFO()似乎覺得../ MAMP下我的php.ini文件/ ...並沒有這樣做時,從/ etc讀取PMP -m時?

我怎樣才能讓PHP總是找到MAMP下的INI文件,所以我不必使用兩個PHP.INI文件來讓PHPINFO()和PHP -m工作?

如何解決NetBeans問題,現在xDebug似乎已正確安裝,但仍然無法在NetBeans中運行?有這種需要雙php.ini的東西?我可以編譯xdebug嗎,怎麼知道?用xdebug/php的PHP版本的東西?如何檢查?

這裏是PHP -i的結果的一部分:

xdebug 

xdebug support => enabled 
Version => 2.0.4 

Supported protocols => Revision 
DBGp - Common DeBuGger Protocol => $Revision: 1.125.2.6 $ 
GDB - GNU Debugger protocol => $Revision: 1.87 $ 
PHP3 - PHP 3 Debugger protocol => $Revision: 1.22 $ 

Directive => Local Value => Master Value 
xdebug.auto_trace => Off => Off 
xdebug.collect_includes => On => On 
xdebug.collect_params => 0 => 0 
xdebug.collect_return => Off => Off 
xdebug.collect_vars => Off => Off 
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.idekey => pettermagnusson => netbeans-xdebug 
xdebug.manual_url => http://www.php.net => http://www.php.net 
xdebug.max_nesting_level => 100 => 100 
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_enable => On => On 
xdebug.remote_handler => dbgp => dbgp 
xdebug.remote_host => 127.0.0.1 => 127.0.0.1 
xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log 
xdebug.remote_mode => req => req 
xdebug.remote_port => 9000 => 9000 
xdebug.show_exception_trace => Off => Off 
xdebug.show_local_vars => Off => Off 
xdebug.show_mem_delta => 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 

RGDS PM

+0

爲了簡化問題很多: 任何人都可以想出一個理由塔t當xDebug似乎已安裝時,NeatBeans無法連接到xDebug在使用php_info()或php -i和php -m進行檢查時,確定是否正常? – 2010-01-06 12:48:53

回答

0

我從科莫多下載了錯誤的xDebug.so,不管怎樣也是我自己的構建是沒有好。再次下載,現在確定。哇,這花了我好幾個小時,也沒人能幫忙! /PM

3
How come PHP_INFO() seemed to find my PHP.INI file under ../MAMP/... and not when doing PMP -m when it is read from /etc ? 

phpinfo()使用甲基苯丙胺的PHP程序,而CLI使用您的操作系統之一。

How can I get PHP to always find the INI file under MAMP so I dont have to use two PHP.INI files to et PHPINFO() and PHP -m to work? 

離開OS PHP不變,所以你沒有問題的升級和調整的一個與MAMP bubled根據您的需要。

How can I resolve the NetBeans problem now that xDebug seems to be installed correctly but still not working in NetBeans? Something with this need for dual php.ini? Could I have compiled xdebug wrong, how to know? Something with php versions in xdebug/php? How to check? 

下載MAMP的最新版本,其中包括Xdebug擴展編譯並添加到您的php.ini

zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" 
xdebug.remote_host=localhost 
xdebug.remote_port=9001 
xdebug.remote_enable=1 
xdebug.idekey="netbeans-xdebug" 
xdebug.remote_log="/Applications/MAMP/logs/xdebug.log" 

我使用端口9001,因爲OSX似乎不喜歡默認。

0

我檢查並重新檢查了所有的設置和設置說明,但仍然顯示XDebug沒有工作。最後,我重新啓動了我的Mac,它開始工作。也許這會幫助和我一樣的人。

0

這對我有什麼工作

brew install php55-xdebug

  • 搶INI路徑,然後粘貼以下到最後
    php -i | grep 'Configuration File'
    vim /usr/local/etc/php/5.5/php.ini

  • 添加以下

    的zend_extension = 「/ usr/lib中/ PHP /擴展/無調試非ZTS-20100525/xdebug.so」

    xdebug.default_enable = 1
    xdebug.remote_enable = 1
    xdebug.remote_handler = dbgp 01​​ xdebug.remote_host =本地主機
    xdebug.remote_port = 9001
    xdebug.remote_autostart = 1