標籤:server eve 官網 mil static 查看 tps 堆棧 evel
安裝php xdebug調試工具及效能分析工具webgrind for windows
第一步:查看php版本等資訊
phpinfo();
上面是 x86 NTS VC14
第二步: 下載xdebug
官網 https://xdebug.org/
第三步:
下載擴充, 放入php的/ext 擴充目錄
第四步: php.ini 開啟擴充
配置其它選項:
[Xdebug]
;指定Xdebug擴充檔案的絕對路徑
zend_extension="C:\App\php\php\php-7.0.12-nts\ext\php_xdebug-2.7.0alpha1-7.0-vc14-nts.dll"
;最大迴圈或調試次數,防止死迴圈
xdebug.max_nesting_level=50
;啟用效能檢測分析
xdebug.profiler_enable=On
;啟用代碼自動跟蹤
xdebug.auto_trace=on
;允許收集傳遞給函數的參數變數
xdebug.collect_params=On
;允許收集合函式調用的傳回值
xdebug.collect_return=On
;指定堆疊追蹤檔案的存放目錄
xdebug.trace_output_dir="C:\App\php\debug"
;指定效能分析檔案的存放目錄
xdebug.profiler_output_dir="C:\App\php\debug"
;追加
xdebug.profiler_append=1
;指定追蹤檔案名稱格式
;xdebug.profiler_output_name = "cachegrind.out.%c"
xdebug.profiler_output_name = "cachegrind.out.%s"
;遠端偵錯是否開啟
xdebug.remote_enable = On
;連接埠
xdebug.remote_port=9000
;遠端偵錯地址
xdebug.remote_host = 127.0.0.1
;數組或對象最大層數 最大可設定1023
xdebug.var_display_max_depth = 10
;將require,include相關載入的檔案名稱寫入追蹤檔案
xdebug.collect_includes=1
;堆棧追蹤
xdebug.default_enable=1
;列印請求方式
xdebug.dump.SERVER=REQUEST_METHOD
;列印GET請求參數
xdebug.dump.GET=*
;列印POST請求參數
xdebug.dump.POST=*
;列印COOKIE
;xdebug.dump.COOKIE=*
;列印UA
;xdebug.dump.SERVER=HTTP_USER_AGENT
配置好重啟伺服器
第五步: 使用
接下來使用xdebug的日誌分析工具分析
xdebug 日誌分析工具 webgrind v1.5
: https://github.com/jokkedk/webgrind
下載後如果是壓縮包解壓後 ,
開啟config.php 配置
static $storageDir = ‘C:/App/php/debug‘; // 配置為xdebug xdebug.profiler_output_dir 所指的目錄
運行測試代碼後, 訪問webgrind的入口, 查看
/END
安裝php xdebug調試工具及效能分析工具webgrind for windows