failed to execute cmd: " dot -Tpng". stderr: `sh: dot: command not found '
xhprof查看性能測(cè)試圖一直報(bào)錯(cuò):failed to execute cmd: ” dot -Tpng”多種因素解決方案
最近在新環(huán)境進(jìn)行php代碼性能測(cè)試,用了xhprof這個(gè)工具,搭建好以后,點(diǎn)擊[View Full Callgraph]查看性能分析圖鏈接一直報(bào)錯(cuò):failed to execute cmd: ” dot -Tpng”
原因一:未安裝graphviz
如果看到 sh: dot: command not found ,說(shuō)明服務(wù)器上沒(méi)有安裝畫(huà)圖軟件graphviz
2.yum安裝: yum install graphviz
源碼安裝到這里下載
原因二:php.ini設(shè)置了禁用proc_open方法
如果安裝好了graphviz,仍然出現(xiàn)”failed to execute cmd”,檢查下服務(wù)器上的php.ini中disable_functions這項(xiàng)是不是限制了proc_open,因?yàn)樵趚hprof_lib/utils/callgraph_utils.php的xhprof_generate_image_by_dot中使用了proc_open函數(shù),
2.設(shè)置“disable_functions = “ 即可,一般沒(méi)有必要在php.ini中關(guān)閉函數(shù)使用,人為修煉代碼技術(shù)即可
xhprof查看性能測(cè)試圖一直報(bào)錯(cuò):failed to execute cmd:
https://blog.51cto.com/u_15127623/3584540