Blackfire配置文件命令行脚本


Blackfire profile cli scripts

我想使用blackfire来配置symfony的php命令。我遵循这里的入门部分https://blackfire.io/getting-started mac os。

然后我用以下内容创建一个test.php文件来测试blackfire:

<?php
    echo "Hello World !";

但当我这样做

blackfire run php test.php

出现错误:

PHP Warning:  PHP Startup: blackfire: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
Warning: PHP Startup: blackfire: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0

如果我删除php.ini的以下代码,我没有任何错误,但blackfire不给我url来查看调试结果

[blackfire]
extension="/usr/local/Cellar/blackfire-php56/1.0.0/blackfire.so"
blackfire.agent_timeout = 0.25

谁能帮我一下?

我发现我的错误了,

$ php -v

给我
PHP 5.5.25 (cli)
[...]

,我安装了错误的blackfire版本

brew install blackfire-php56

所以我卸载blackfire并重新安装

brew uninstall blackfire-php56
brew install blackfire-php55

最后我更新了php.ini

[blackfire]
extension="/usr/local/Cellar/blackfire-php55/1.0.0/blackfire.so"
blackfire.agent_timeout = 0.25