Genkit Vertex AI 插件完全指南:Model Garden、Rerankers、Evaluation 与 Vector Search 实战
2026/9/17 21:54:29
这个错误“Are you authorized to profile this page? No probe response, Blackfire not properly installed or invalid signature for relaying agent.”表明 Blackfire 无法与目标 PHP 应用建立通信。
Blackfire Profiler 工作需三个组件协同:
❌错误含义:
Probe 未响应 Client 请求→ 可能是未安装、配置错误或权限问题。
blackfire.so扩展agent.ini中的server-id/server-token无效www-data)无权访问 Agent socket127.0.0.1:8307)# 查看 PHP 模块php -m|grepblackfire# 检查 php.ini 配置php --ini|xargscat|grepblackfireblackfire出现在模块列表中extension=blackfire.so存在于配置文件# 检查 Agent 进程psaux|grepblackfire-agent# 查看 Agent 日志(Linux)sudotail-f /var/log/blackfire/agent.logStarting agent→ 正常启动Invalid credentials→ 密钥错误# 检查 Agent 监听端口ss -tuln|grep8307# 手动请求 Probecurl-H"X-Blackfire-Query: ..."http://127.0.0.1:8307~/.blackfire.ini(Client)/etc/blackfire/agent.ini(Agent)# Ubuntu/Debiancurl-sS https://packages.blackfire.io/gpg.key|sudoapt-keyadd-echo"deb http://packages.blackfire.io/debian any main"|sudotee/etc/apt/sources.list.d/blackfire.listsudoapt-getupdatesudoapt-getinstallblackfire-php# 重启 Web 服务器sudosystemctl restart apache2# 或 php-fpm/nginx# 启动 Agentsudosystemctl start blackfire-agent# 设置开机自启sudosystemctlenableblackfire-agentRUN curl -sS https://get.blackfire.io | bash RUN echo "blackfire.agent_socket=tcp://blackfire-agent:8307" >> /usr/local/etc/php/conf.d/blackfire.ini; ~/.blackfire.ini [client] endpoint=https://blackfire.io server-id=YOUR_SERVER_ID server-token=YOUR_SERVER_TOKEN ; /etc/blackfire/agent.ini [agent] server-id=YOUR_SERVER_ID server-token=YOUR_SERVER_TOKEN⚠️必须完全一致!从 Blackfire Account Settings 复制
# CLI 模式BLACKFIRE_AGENT_SOCKET=tcp://127.0.0.1:8307 blackfire run php script.php; /etc/blackfire/agent.ini [agent] log_level=4 log_file=/var/log/blackfire/agent-debug.logblackfire.so在FPM 的 php.ini中(非 CLI 的 ini); /etc/php/8.1/fpm/pool.d/www.conf php_admin_value[blackfire.server_id] = YOUR_ID php_admin_value[blackfire.server_token] = YOUR_TOKEN**“Blackfire 的错误,
不是工具的缺陷,
而是环境的裂痕——
- 当你检查Probe,
你在确认 PHP 的感知;- 当你验证Agent,
你在打通数据的脉络;- 当你校准签名,
你在建立信任的契约。真正的性能分析,
始于环境的完整,
成于数据的精准。”
从今天起:
agent.log定位根本原因因为最好的性能优化,
始于一个能正常工作的 Profiler。