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]