linux dot 实用程序(使用 xhprof)
我安装了 php 的 xhprof 分析扩展
一切都很好,除了 callgraph.php 文件,它返回: 无法 shell 执行 cmd=" dot -Tpng"
所以我检查了一下,发现 dot 实用程序没有安装,所以我安装了它。
它似乎从命令行运行良好,所以我再次运行脚本,同样的错误: 无法 shell 执行 cmd=" dot -Tpng"
xhprof 文档指出: callgraph 图像可视化([View Callgraph])功能依赖于路径中 Graphviz“点”实用程序的存在。
但我不明白我现在需要做什么,特别是“实用程序”你的道路”部分
任何帮助表示赞赏,谢谢大家
i installed the xhprof profiling extension for php
Everything is fine except for the callgraph.php file, it returns:failed to shell execute cmd=" dot -Tpng"
so i checked and the dot utility wasn't installed, so i installed it.
it appears to be running fine from the command line so i ran the scritp again, same error:failed to shell execute cmd=" dot -Tpng"
the xhprof documentation states:the callgraph image visualization ([View Callgraph]) feature relies on the presence of Graphviz "dot" utility in your path.
but i don't understand what i need to do now, specifically the "utility in your path" part
Any help appreciated, thanks guys
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您想要 xhprof 的图形功能,请在终端中运行下一个命令:
If you want graphing functions for xhprof run next command in terminal:
当我启用 error_reporting 时,我发现缺少一些配置变量:
将以下行添加到 xhprof_lib/config.php 后,它可以工作
When I enable error_reporting, I see there are some configuration variable are missing:
After add the following lines to xhprof_lib/config.php, it works
如果您安装了graphviz,由于安全限制,也会出现此错误。某些功能可能被禁用。因此,请查看您的日志以获取一些 php 警告。
例如:
您需要配置php.ini或security.ini参数“disable_functions”。
If you have installed graphviz this error also will occure because of the security restrictions. Some functions may be disabled. So, see your logs for some php warnings.
For example:
You need to configure php.ini or security.ini parameter "disable_functions".
该实用程序“位于您的路径中”意味着可以通过环境变量 PATH 找到它。此环境变量包含 shell 在其中查找您在没有显式路径的情况下运行的二进制文件的目录。
假设
dot
的完整路径是/opt/foo/bin/dot
。然后你想这样修改你的PATH
环境变量:Having the utility "in your path" means that it can be located by the environment variable
PATH
. This environment variables contains directories where the shell looks for binaries that you run without an explicit path.Let's say the full path to
dot
is/opt/foo/bin/dot
. Then you want to modify yourPATH
environment variable this way:就我而言,这只是因为未安装 graphviz 造成的。您可以在命令行上使用
which dot
或locate graphviz
进行检查。In my case this was caused simply because graphviz was not installed. You can check with
which dot
orlocate graphviz
on the command line.如果您有 Graphviz 但仍然收到错误,快速解决问题的步骤:
steps for fast fix the issue if you have Graphviz and still getting error: