1. 程式人生 > >xhprof查看性能測試圖一直報錯:failed to execute cmd: " dot -Tpng"多種因素解決方案

xhprof查看性能測試圖一直報錯:failed to execute cmd: " dot -Tpng"多種因素解決方案

not 方案 報錯 execute 下載 畫圖 graphviz png 性能測試

xhprof查看性能測試圖一直報錯:failed to execute cmd: ” dot -Tpng”多種因素解決方案
最近在新環境進行php代碼性能測試,用了xhprof這個工具,搭建好以後,點擊[View Full Callgraph]查看性能分析圖鏈接一直報錯:failed to execute cmd: ” dot -Tpng”

原因一:未安裝graphviz
如果看到 sh: dot: command not found ,說明服務器上沒有安裝畫圖軟件graphviz
2.yum安裝: yum install graphviz
源碼安裝到這裏下載

原因二:php.ini設置了禁用proc_open方法
如果安裝好了graphviz,仍然出現”failed to execute cmd”,檢查下服務器上的php.ini中disable_functions這項是不是限制了proc_open,因為在xhprof_lib/utils/callgraph_utils.php的xhprof_generate_image_by_dot中使用了proc_open函數,
2.設置“disable_functions = “ 即可,一般沒有必要在php.ini中關閉函數使用,人為修煉代碼技術即可

xhprof查看性能測試圖一直報錯:failed to execute cmd: " dot -Tpng"多種因素解決方案