Stackdriver Error Reporting for PHP Stay organized with collections Save and categorize content based on your preferences.
Beta
This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.
Idiomatic PHP client forStackdriver Error Reporting.
NOTE: This repository is part ofGoogle Cloud PHP. Anysupport requests, bug reports, or development contributions should be directed tothat project.
Stackdriver Error Reporting counts, analyzes and aggregates the crashes in your running cloud services.
Installation
To begin, install the preferred dependency manager for PHP,Composer.
Now install this component:
$ composer require google/cloud-error-reportingThis component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods)please see ourgRPC installation guide.
Authentication
Please see ourAuthentication guide for more informationon authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
use Google\ApiCore\ApiException;use Google\Cloud\ErrorReporting\V1beta1\Client\ErrorGroupServiceClient;use Google\Cloud\ErrorReporting\V1beta1\ErrorGroup;use Google\Cloud\ErrorReporting\V1beta1\GetGroupRequest;// Create a client.$errorGroupServiceClient = new ErrorGroupServiceClient();// Prepare the request message.$request = (new GetGroupRequest()) ->setGroupName($formattedGroupName);// Call the API and handle any network failures.try { /** @var ErrorGroup $response */ $response = $errorGroupServiceClient->getGroup($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());} catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());}Debugging
Please see ourDebugging guidefor more information about the debugging tools.
Version
This component is considered beta. As such, it should be expected to be mostlystable and we're working towards a release candidate. We will address issuesand requests with a higher priority.
Next Steps
- Understand theofficial documentation.
- Take a look atin-depth usage samples.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-04 UTC.