2023-03-13 xhprof查看性能测试图一直报错:failed to execute cmd

failed to execute cmd: " dot -Tpng". stderr: `sh: dot: command not found '

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:
https://blog.51cto.com/u_15127623/3584540

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容