xdebug+webgrind对php5.6做性能分析环境搭建

python3安装

wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tar.xz mkdir -p /usr/local/code/python3 tar -xvf Python-3.7.7.tar.xz -C /usr/local/code cd /usr/local/code/Python-3.7.7/ && ./configure prefix=/usr/local/python3 make && make install ln -s /usr/local/python3/bin/python3 /usr/bin/python3

dot命令安装
yum -y install graphviz

xdebug安装
https://xdebug.org/docs/install
pecl install xdebugmkdir -p /tmp/xdebug chown -R www:www /tmp/xdebug///修改php.ini zend_extension=xdebug.so [xdebug] xdebug.profiler_append=0 xdebug.profiler_output_name="cachegrind.out.%R%u" xdebug.profiler_enable=On xdebug.profiler_output_dir="/tmp/xdebug/" xdebug.profiler_enable_trigger=On

webgrind可视化界面
git clone https://github.com/jokkedk/webgrind.git//修改config.php修改成 static $storageDir = '/tmp/xdebug/'; static $profilerDir = '/tmp/xdebug/';

    推荐阅读