XHProf是一个轻量级的PHP性能分析工具.php
使用XHProf的时候,在点击[View Full Callgraph]查看结果分析图时,会报错, 缘由是缺乏graphviz绘图软件。html
在使用 brew安装graphviz软件出现了一些错误,特此记录一下.git
首先使用brew搜索是否存在graphviz软件,报错:github
$ brew search graphviz Error: GitHub { "message": "Bad credentials", "documentation_url": "https://developer.github.com/v3" } The GitHub credentials in the OS X keychain may be invalid. Clear them with: printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase Or create a personal access token: https://github.com/settings/tokens/new?scopes=&description=Homebrew and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token"
这个错误描述的很清楚,系统钥匙串中的GitHub证书可能已失效。 解决办法也有了: (1) 清除 (2)或者从新生成一个TOKEN工具
按照第一种方式,报错:性能
$ printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase $ brew search graphviz Error: GitHub API Error: API rate limit exceeded for 116.236.188.123. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) Try again in 48 minutes 33 seconds, or create a personal access token: https://github.com/settings/tokens/new?scopes=&description=Homebrew and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token"
建立一个私人的访问TOKEN:url
打开连接:code
https://github.com/settings/tokens/new?scopes=&description=Homebreworm
点击 "Generate token” 按钮,生成TOKEN, 好比本次生成的TOKEN: 00dc6141d83e69ec1fc3bwyt68cnwyt82eb063bdhtm
在终端执行: export HOMEBREW_GITHUB_API_TOKEN=“your_new_token"
$ export HOMEBREW_GITHUB_API_TOKEN="00dc6141d83e69ec1fc3bwyt68cnwyt82eb063bd" // 继续安装软件 $ brew search graphviz $ brew install graphviz
graphviz安装成功。 在XHProf结果报告中点击[View Full Callgraph]也会生成图像。
XHProf是一个轻量级的PHP性能分析工具(层次式性能分析器,Hierarchical Profiler)。 Graphviz is open source graph visualization software。 Brew 又叫Homebrew, 是Mac OSX上的软件包管理工具。
http://www.graphviz.org/ http://avnpc.com/pages/profiler-php-performance-online-by-xhprof http://www.cnblogs.com/phoenix-fec/p/5286695.html
[END]