hyperf容器内安装xdebug,并使用生成链路图【hyperf/hyperf:8.1-alpine-v3.16-swoole】

发布时间 2024-01-04 10:04:34作者: cnlihao

1.重新安装pecl

apk update
apk add php81-dev php81-pear gcc g++ linux-headers libc-dev make libtool
pecl install xdebug

2.修改xdebug配置

cd /etc/php81
vim php.ini

#添加:
zend_extension=xdebug
xdebug.mode=trace,profile
xdebug.start_with_request=yes
xdebug.trigger_value=StartProfileForMe
xdebug.trace_output_name = xdebug.trace.%t.%s
xdebug.output_dir = /tmp
xdebug.trace_format=1