在 Docker 中与 PHP Swoole 一起运行 Blackfire 时出现问题

问题描述

有没有人设法将 Blackfire 与 Swoole 一起使用?我已经尝试设置了几天,但没有成功。

我在 PHP-CLI Swoole Dockerfile 中调用以下脚本:

const planList = [
    'military_greekHero_achilles_week_1.htm','military_greekHero_achilles_week_2.htm'
];

var _completePlan = {};


planList.forEach(_plan => {

        // Pull data from the file name formated: target_series_title_overview/week_weekNum.htm
            let _planPieces = _plan.split('.')[0].split('_'),// Drop the .htm
                _planTarget = _planPieces[0],_planSeries = _planPieces[1],_planTitle = _planPieces[2],_planOverview = _planPieces[3],_planWeek = _planPieces[4];

            _planOverview = _planOverview == 'overview' ? true : false;
            
        // Start Building Plan Object
            

        // _planWeek logs 1 and 2 while iterating but entry for .weeks.1 is overwritten with .weeks.2
            _completePlan[_planTitle] = _completePlan[_planTitle] || {};
            _completePlan[_planTitle].info = _completePlan[_planTitle].info || {};
            _completePlan[_planTitle].weeks = _completePlan[_planTitle].weeks || {};


            _completePlan[_planTitle].weeks[_planWeek] = {
                sn: { inactive: true },mo: { inactive: true },tu: { inactive: true },we: { inactive: true },th: { inactive: true },fr: { inactive: true },st: { inactive: true }
    }
});
console.log(_completePlan);

主管确认:

#!/usr/bin/env bash

# @see https://blackfire.io/docs/up-and-running/installation

set -e

apt-get update
apt-get install -y gnupg --no-install-recommends

# Configure the Debian Repository
wget -q -O - https://packages.blackfire.io/gpg.key | apt-key add -
echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list
apt-get update

# Install and Configure the Agent
echo "$(date '+%Y-%m-%d %H:%M:%s,%3N') $(tput bold)$(tput setaf 4)INFO$(tput sgr0) Install and Configure the Agent."
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install blackfire
blackfire agent:config --server-id=MY-SERVER-ID --server-token=MY-SERVER-TOKEN
/etc/init.d/blackfire-agent restart

# Install the PHP Probe
echo "$(date '+%Y-%m-%d %H:%M:%s,%3N') $(tput bold)$(tput setaf 4)INFO$(tput sgr0) Install the PHP Probe."
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install blackfire-PHP

# Clear
rm -r /var/lib/apt/lists/*
mkdir -p /var/run/blackfire

使用 blackfire curl 的错误消息:

[supervisord]
user = root

[program:blackfire-agent]
command = /usr/bin/blackfire agent:config --server-id=MY_BLACKFIRE_SERVER_ID --server-
token=MY_BLACKFIRE_SERVER_TOKEN
user = root
autostart = true
autorestart = true
stdout_logfile = /proc/self/fd/1
stdout_logfile_maxbytes = 0
stderr_logfile = /proc/self/fd/1
stderr_logfile_maxbytes = 0

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)