PDT + Xdebug 調試 PHP

來源:互聯網
上載者:User
環境:

PHP Version 5.2.9-1

Apache 2.2.11

Mysql5.0

PDT(PHP Development Tools)

http://www.eclipse.org/pdt/downloads/

下載pdt all-in-ones,我下的版本是pdt-all-in-one-win32-2.0.0GA.zip

http://www.xdebug.org/download.php

下載xdebug,對應的php版本,由於我的是php5.2.9

xdebug沒有對應的5.2.9。所以選擇5.2.5或者5.2.8(之前下過5.3.0,沒有配置成功)

php_xdebug-2.0.3-5.2.5.dll 或 php_xdebug-2.0.4-5.2.8.dll

將xdebug放進C:\Program Files\PHP\ext目錄

修改php.ini配置,加入xdebug的配置資訊:

[Xdebug]
;extension=php_xdebug-2.0.3-5.2.5.dll ;這裡可是花了大半天的時間,無法調試斷點,斷點不起作用,Xdebug必須得使用zend_extension_ts來掛載
zend_extension_ts="C:/Program Files/PHP/ext/php_xdebug-2.0.3-5.2.5.dll"
xdebug.auto_trace = On
xdebug.show_exception_trace = On
xdebug.remote_autostart = On
xdebug.remote_enable = On
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = On
xdebug.trace_output_dir="c:/Program Files/PHP/debuginfo" ;這個目錄預設是沒有的,必須手動去建立
xdebug.profiler_output_dir="c:/Program Files/PHP/debuginfo"

重啟apache,具體調試方式可參考下面連結:

玩轉PHP調試:PHP Debug

  • 聯繫我們

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