Xdebug版本下載
http://www.xdebug.com/download.php
注意在下載Xdebug時我們必須查看自己php版本之後與xdebug一樣,並且要查看你的php是安全執行緒或非線程式安全的,否則可以沒有用哦。
下載好 php_xdebug.dll 之後我們複製到你的php ext目錄,如
D:/phpStudy/PHP5/ext/php_xdebug.dll
這個是我本地的,放好之後再把php.ini檔案進行修改,加入下面代碼
| 代碼如下 |
複製代碼 |
|
[Xdebug]
zend_extension="D:/phpStudy/PHP5/ext/php_xdebug.dll"
xdebug.collect_return=1
xdebug.show_mem_delta=1
xdebug.show_exception_trace=1
xdebug.idekey="PHPStorm"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.auto_trace=0 錯誤跟蹤提示0關閉,1開啟
xdebug.trace_output_name=%s.trace.log
xdebug.trace_output_dir="E:/XDebug/Trace"
xdebug.profiler_enable=0
xdebug.profiler_output_name=%s.profiler.log
xdebug.profiler_output_dir="E:/XDebug/Profiler" |
好了最後一步重啟apache就可以解決了哦,然後我們來檢查一下Xdebug配置安裝是否成功了,我們在一個php測試一下phpinfo()
如果在截圖處可看到with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
就代碼成功了
現在我們測試一段代碼
是不是非常詳細的告訴我們錯誤資訊了呀。