程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> Xdebug+ZendStudio配置,xdebugzendstudio

Xdebug+ZendStudio配置,xdebugzendstudio

編輯:關於PHP編程

Xdebug+ZendStudio配置,xdebugzendstudio


原文鏈接:http://www.orlion.ga/689/

好久之前就知道有這麼個東西,但是一直沒用,一直用exit()、var_dump() debug,效率很低。

首先下載xdebug的dll文件(Window環境下)網址是:https://xdebug.org/download.php,此次下載的是php_xdebug-2.3.3-5.5-vc11-x86_64.dll。(這是個線程安全版的)下載完成後放到php安裝目錄的ext文件夾下。然後再配置php.ini添加這麼幾行:

XDEBUG Extension

zend_extension="C:\wamp\bin\php\php5.5.12\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll"
;允許遠程IDE調試
xdebug.remote_enable=true
;遠程主機
xdebug.remote_host=127.0.0.1

xdebug.profiler_enable=on
;臨時跟蹤信息輸出
;xdebug.trace_output_dir="C:\wamp\xdebug\trace"
;xdebug.profiler_output_dir="C:\wamp\xdebug\profiler"

xdebug.auto_trace=On
;開啟異常跟蹤
xdebug.show_exception_trace=On
;開啟遠程調試自動啟動
xdebug.remote_autostart=On
;收集變量
xdebug.collect_vars=On
;收集返回值
xdebug.collect_return=On
;收集參數
xdebug.collect_params=On
;顯示局部變量
xdebug.show_local_vars=On
;顯示默認的錯誤信息
xdebug.default_enable=On
;用於zend studio遠程調試的應用層通信協議
xdebug.remote_handler=dbgp
;如果設得太小,函數中有遞歸調用自身次數太多時會報超過最大嵌套數錯
xdebug.max_nesting_level=10000

    可參考:http://www.cnblogs.com/dreamhome/p/3218744.html,http://blog.csdn.net/xinzheng_wang/article/details/37930233

 

    然後配置ZendStudio(這裡是ZendStudio 12.5.1):

    1. Window->Preferences->PHP->PHP Executables->Add如下:

    2. Window->Preferences->PHP->Debug:

      上圖中的PHP Server:wamp_apache是之前配置好的,最好配置一個

    3. 然後就可以創建文件加斷點,然後文件右鍵->Debug as->PHP CLI Application。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved