POST / 2024-11-21
xhprof
1. 安装扩展 1. 下载 1. 解压后进入extension目录安装 1. xhprof html为前端显示使用 1. index.php和callgraph.php引入了xhprof lib,需要注意一下路径 1. 配置php.ini 4. 配置nginx 查看图片报错:fa
-
安装扩展
-
下载
-
解压后进入extension目录安装
-
xhprof_html为前端显示使用
-
index.php和callgraph.php引入了xhprof_lib,需要注意一下路径
-
配置php.ini
extension=xhprof.so
xhprof.output_dir=/var/www/html/xhprof_html/xhprof_runs/
- 配置nginx
server {
listen 80;
server_name xhprof.localhost.com;
root /var/www/html/xhprof_html/xhprof_html;
index index.php;
location ~ \.php$ {
error_page 500 502 503 504 /static/error_pc_5xx.html;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME "$document_root$fastcgi_script_name";
fastcgi_pass php;
}
}
查看图片报错:failed to execute cmd: ” dot -Tsvg”. stderr: `sh: dot: command not found ‘
需要安装graphviz才能查看图片
brew install graphviz 需要翻墙
使用源码安装