chrome瀏覽器下的xdebug helper使用教程

2013-02-24 10:53:35來(lái)源:linuxde作者:

安裝了xdebug后,發(fā)現(xiàn)每次調(diào)試都需要從eclipse中先從頭啟動(dòng),然后一步步走到你要調(diào)試的頁(yè)面,而不是說(shuō)想什么時(shí)候調(diào)試就什么時(shí)候調(diào)試。

安裝了xdebug后,發(fā)現(xiàn)每次調(diào)試都需要從eclipse中先從頭啟動(dòng),然后一步步走到你要調(diào)試的頁(yè)面,而不是說(shuō)想什么時(shí)候調(diào)試就什么時(shí)候調(diào)試。

之前用zenddebugger的時(shí)候則是可以在任意頁(yè)面啟動(dòng)調(diào)試,直接從瀏覽器通知開(kāi)發(fā)環(huán)境需要調(diào)試。而不用先從開(kāi)發(fā)環(huán)境啟動(dòng)調(diào)試。隨時(shí)需要調(diào)試的時(shí)候就可以執(zhí)行調(diào)試。

后來(lái)發(fā)現(xiàn)了chrome瀏覽器有一款插件叫xdebug helper,火狐下也有easy xdebug,下面主要來(lái)說(shuō)chrome下的xdebug helper

安裝完成xdebug helper后再瀏覽器地址欄的右側(cè)能夠看到一只小爬蟲(chóng),點(diǎn)擊后如下圖所示:

 \

選擇Debug,就會(huì)通知你的開(kāi)發(fā)環(huán)境接下來(lái)的代碼需要開(kāi)始調(diào)試,選擇disable,就會(huì)直接運(yùn)行。

在eclipse中需要進(jìn)行特別的設(shè)置:

進(jìn)入window->Preferences->PHP->Debug

找到配置xdebug中的Accept remote session(JIT),選擇為localhost,并保存。

在PHP的配置文件中對(duì)xdebug的設(shè)置需要特別注意,將xdebug.remote_autostart設(shè)置為off,如果設(shè)置為on,則會(huì)忽略在瀏覽器中是選擇Debug還是Disable,都會(huì)通知eclipse進(jìn)行調(diào)試

xdebug.remote_autostart = Off

這樣,xdebug helper就設(shè)置好了

以下是我的php.ini中對(duì)xdebug的配置

[Xdebug] ;xdebug配置
zend_extension="e:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll" ;載入Xdebug
xdebug.profiler_enable=on
xdebug.trace_output_dir="e:/xdebug-log" ;xdebug 的數(shù)據(jù)文件目錄
xdebug.profiler_output_dir="e:/xdebug-log" ;xdebug 的數(shù)據(jù)文件目錄
xdebug.auto_trace = On ;開(kāi)啟自動(dòng)跟蹤
xdebug.show_exception_trace = On ;開(kāi)啟異常跟蹤
xdebug.remote_autostart = Off ;開(kāi)啟遠(yuǎn)程調(diào)試自動(dòng)啟動(dòng)
xdebug.remote_enable = On ;開(kāi)啟遠(yuǎn)程調(diào)試
xdebug.remote_handler=dbgp ;用于zend studio遠(yuǎn)程調(diào)試的應(yīng)用層通信協(xié)議
xdebug.remote_host=127.0.0.1 ;允許連接的zend studio的IP地址
xdebug.remote_port=9000 ;反向連接zend studio使用的端口
xdebug.collect_vars = On ;收集變量
xdebug.collect_return = On ;收集返回值
xdebug.collect_params = On ;收集參數(shù)
xdebugbug.max_nesting_level = 10000 ;如果設(shè)得太小,函數(shù)中有遞歸調(diào)用自身次數(shù)太多時(shí)會(huì)報(bào)超過(guò)最大嵌套數(shù)錯(cuò)
關(guān)鍵詞:chromexdebug

贊助商鏈接: