php_xdebug安裝+NetBeans的配置和使用

來源:互聯網
上載者:User


1、php_xdebug的安裝及配置:

我是用wampServer2.2的環境的,環境本身內建了對應的xdebug,只需要修改php.ini的配置就可以了。但是php.ini檔案要找對,我一開始就是找錯了檔案,所以配了好久都不生效。

wampServer使用的php設定檔一般都放在wamp安裝目錄的apache裡面,我的是在:D:\wamp\bin\apache\Apache2.2.21\bin\php.ini 。

可以通過phpinfo()方法查看php.ini的位置,直接搜尋php.ini就可以了:

2、修改php.ini

zend_extension = "d:/wamp/bin/php/php5.3.10/zend_ext/php_xdebug-2.1.2-5.3-vc9.dll"

#其中 zend_extension=D:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll 是php5.3以及以上版面的寫法,如果是php5.2以及以下版本的是zend_extensi/php/ext/php_xdebug-2.2.1-5.4-vc9.dll。

[xdebug]
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

#下面是幾個不必須的參數。

xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir="D:/php/debuginfo"
xdebug.profiler_enable=on
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/wamp/tmp"
xdebug.output_buffering=off

xdebug.idekey="ide.xdebug"

trace_output_dir 對於的是類似trace.4046332594.xt的檔案,
profiler_output_dir對應得是類似cachegrind.out.10360 這樣的檔案

然後可以用個phpinfo()函數測試是否成功了。

3、配置netbean

3.2.1重新啟動wamp服務

3.2.2開啟netbeans,工具——選項,找到php表徵圖,在“常規”中PHP5解譯器選擇wamp中的php

如:D:\wamp\bin\php\php5.4.12\php.exe

鉤選:輸出視窗、web瀏覽器

開啟“調試”選項卡,配置調試連接埠為9000(與php.ini中配置一樣)

4、設定項目的屬性

3.3.1建立一個項目,右鍵項目,開啟“項目屬性”對話方塊,選擇“源”,PHP版本選擇為wamp中的php版本一致

3.3.2選擇“回合組態”,運行方式選擇“本地web網站”,項目URL配置為項目的訪問地址,如:http://localhost:9060/項目名/

索引檔案配置為index.php

5、xdebug的使用參考:https://netbeans.org/kb/docs/php/debugging_zh_CN.html#gettingReady

參考文章:http://wayne173.iteye.com/blog/1704453

http://www.2cto.com/os/201404/294008.html





以上就介紹了php_xdebug安裝+NetBeans的配置和使用,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.