php 擴充xdebug的安裝及調試

來源:互聯網
上載者:User

1. xdebug 一定安裝與php版本一致的,否則載入會失敗。安裝的時候查看一下xdebug的安裝說明 主要是 --with-php-config=/php安裝的bin目錄/php-config 要不然找不到安裝的php的版本資訊。


2. 安裝完成後,在php.ini 中增加 zend  擴充,而不是extension

[XDebug]
zend_extension="/home/lyd/download/xdebug-2.1.4/modules/xdebug.so"
xdebug.profiler_enable = on
xdebug.default_enable = on
xdebug.trace_output_dir="/tmp/xdebug"
xdebug.trace_output_name = trace.%c.%p
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.profiler_output_name="cachegrind.out.%s"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=tradeadmin
xdebug.remote_port=9002

要保證程式對/tmp/xdebug有寫入許可權。

3,  重啟php-fpm 和網頁伺服器 ,查看php_info(); 看是否有xdebug的擴充,如果有說明安裝成功。

4. 和開發ide整合  ,以netbeans 為例

netbeans 7.0 中 工具=》選項=》php=》調試
連接埠要和 xdebug.remote_port=9002 設定的一樣,

會話ID:  www  (這個很重要,可能看 php_info() xdebug擴充一項中的 xdebug.idekey  選項  預設應該是 www)

5. 在項目源檔案中右鍵配製項目的web屬性, 即可。



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.