Skip to content

php-sdk broke "suddenly" #78

@asjur

Description

@asjur

We've had a manual trigger for blackfire working for a long time and now it produces an error 500. No code changes has been applied to this for a long time and the only thing that changed was that we moved from PHP7.3 to 8.4 a little while ago.

Using the blackfire browser extension works but we need to be able to trigger manual probes via REST calls as well.

The error in question is:

[31-Jan-2025 13:42:37 Europe/Oslo] PHP Fatal error: Uncaught Error: Class "Blackfire\ClientConfiguration" not found in /home/[REDACTED]/production/releases/75ab326b4e3c66b6dd5c99b306d795edc5d0ea33/public/index.php:146

The error happens on the first line of this codeblock:

$clientConfig = new \Blackfire\ClientConfiguration();
$clientConfig->setClientId('[REDACTED]');
$clientConfig->setClientToken('[REDACTED]');
$blackfire = new \Blackfire\Client($clientConfig);
$probe = $blackfire->createProbe();
register_shutdown_function(static function () use ($blackfire, $probe) {
    $blackfire->endProbe($probe);
});

It is used in the index file of a Symfony project.

When running composer show this is the output, keep in mind that I've tried latest version and slowly gone backwards to see if I could find a working version:

composer show blackfire/php-sdk
name     : blackfire/php-sdk
descrip. : Blackfire.io PHP SDK
keywords : performance, profiler, uprofiler, xhprof
versions : * v2.5.4
released : 2024-09-18, 4 months ago
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source   : [git] https://github.com/blackfireio/php-sdk.git 4b46450f30ef50bcde331d6c360b9f3a3a42bfe6
dist     : [zip] https://api.github.com/repos/blackfireio/php-sdk/zipball/4b46450f30ef50bcde331d6c360b9f3a3a42bfe6 4b46450f30ef50bcde331d6c360b9f3a3a42bfe6
path     : /home/[REDACTED]/production/releases/75ab326b4e3c66b6dd5c99b306d795edc5d0ea33/vendor/blackfire/php-sdk
names    : blackfire/php-sdk

support
issues : https://github.com/blackfireio/php-sdk/issues
source : https://github.com/blackfireio/php-sdk/tree/v2.5.4

autoload
psr-4
Blackfire\ => src/Blackfire

requires
composer/ca-bundle ^1.0
php >=5.3.0

requires (dev)
behat/behat ^3.8
friends-of-behat/mink-browserkit-driver ^1.4
friends-of-behat/mink-extension ^2.5
friends-of-behat/symfony-extension ^2
guzzlehttp/psr7 ^1.6
illuminate/console ^8.81
illuminate/queue ^8.81
illuminate/support ^8.81
laravel/octane ^1.2
phpunit/phpunit ^9.5
psr/http-message ^1.0
symfony/browser-kit ^5.1
symfony/framework-bundle ^5.1
symfony/http-client ^5.1
symfony/messenger ^5.1
symfony/panther ^1.0
symfony/phpunit-bridge ^5.2

suggests
ext-blackfire The C version of the Blackfire probe
ext-zlib To push config to remote profiling targets
symfony/panther To use Symfony web test cases with Blackfire

Any suggestion would be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions