PHPackages                             perfbase/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. perfbase/php-sdk

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

perfbase/php-sdk
================

An SDK for sending profiling data to Perfbase

v1.8.0(1mo ago)01.9k11Apache-2.0PHPPHP &gt;=7.4 &lt;8.6CI passing

Since Nov 7Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/perfbaseorg/php-sdk)[ Packagist](https://packagist.org/packages/perfbase/php-sdk)[ Docs](https://github.com/perfbaseorg/php-sdk)[ RSS](/packages/perfbase-php-sdk/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (7)Versions (36)Used By (11)

 [ ![Perfbase](https://camo.githubusercontent.com/a4e071fd1246cf5c68819015801139400d74b208b76a07ba8c5945d6e4ffd3ba/68747470733a2f2f63646e2e70657266626173652e636f6d2f696d672f6c6f676f2d66756c6c2e737667) ](https://perfbase.com)

### Perfbase PHP SDK

[](#perfbase-php-sdk)

 The official PHP SDK for [Perfbase](https://perfbase.com) — application performance monitoring and profiling for PHP applications.

 [![Packagist Version](https://camo.githubusercontent.com/5440938f33a236326710ab6e3f592e0df394c340b29d5ac6f4968f9e4981eaa1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70657266626173652f7068702d73646b)](https://packagist.org/packages/perfbase/php-sdk) [![License](https://camo.githubusercontent.com/bd1900c86ff4815fcb0198537d45251cd15e80e6aad8299c8ee7b7975d3fdfbc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70657266626173652f7068702d73646b)](https://github.com/perfbaseorg/php-sdk/blob/main/LICENSE.txt) [![CI](https://camo.githubusercontent.com/df9f4e692697748cab9cc4b260f7d40a8b9d1e98caaaff6cc062dff9543c2b5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70657266626173656f72672f7068702d73646b2f63692e796d6c3f6272616e63683d6d61696e)](https://github.com/perfbaseorg/php-sdk/actions/workflows/ci.yml) [![PHP Version](https://camo.githubusercontent.com/1150142271e92a6b30ce3ef37f5548f25d15d1e9cd200eea972f746cc7a2c40a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c7565)](https://camo.githubusercontent.com/1150142271e92a6b30ce3ef37f5548f25d15d1e9cd200eea972f746cc7a2c40a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c7565)

Using a PHP framework?
----------------------

[](#using-a-php-framework)

If you're using a PHP framework, we recommend using our dedicated framework integrations for the best experience:

- **Laravel**: [`perfbase/laravel`](https://packagist.org/packages/perfbase/laravel)
- **Symfony**: [`perfbase/symfony`](https://packagist.org/packages/perfbase/symfony)
- **WordPress**: [`perfbase/wordpress`](https://packagist.org/packages/perfbase/wordpress)
- **CakePHP**: [`perfbase/cakephp`](https://packagist.org/packages/perfbase/cakephp)
- **Drupal**: [`perfbase/drupal`](https://packagist.org/packages/perfbase/drupal)
- **Slim**: [`perfbase/slim`](https://packagist.org/packages/perfbase/slim)
- **Joomla**: [`perfbase/joomla`](https://packagist.org/packages/perfbase/joomla)
- **CodeIgniter 4**: [`perfbase/codeigniter4`](https://packagist.org/packages/perfbase/codeigniter4)
- **Yii 1.1**: [`perfbase/yii1`](https://packagist.org/packages/perfbase/yii1)
- **Yii 2**: [`perfbase/yii2`](https://packagist.org/packages/perfbase/yii2)
- **Yii 3**: [`perfbase/yii3`](https://packagist.org/packages/perfbase/yii3)

If you're not using a framework or need a custom integration, this SDK is for you.

Features
--------

[](#features)

- **Real-time performance profiling** — CPU time, memory usage, and execution tracing
- **Multi-span tracing** — track multiple concurrent operations within a single request
- **Database query tracking** — monitor PDO, MongoDB, Elasticsearch queries
- **HTTP request monitoring** — track outbound HTTP calls and API requests
- **Cache operation tracking** — monitor Redis, Memcached, and other cache operations
- **Queue system monitoring** — track background job performance
- **Custom attributes** — add contextual metadata to your traces
- **Configurable feature flags** — enable/disable specific profiling features
- **Multi-tenant support** — organization and project-level data isolation

Requirements
------------

[](#requirements)

- **PHP**: `7.4` to `8.5`
- **Operating System**: Linux or macOS (Windows not supported)
- **Dependencies**:
    - `ext-curl` (usually enabled by default)
    - `ext-perfbase` (Perfbase PHP extension)
- **Package Manager**: Composer

Installation
------------

[](#installation)

### 1. Install the SDK

[](#1-install-the-sdk)

```
composer require perfbase/php-sdk:^1.0
```

### 2. Install the Perfbase PHP Extension

[](#2-install-the-perfbase-php-extension)

The `ext-perfbase` PHP extension is required for the SDK to function. Install it using:

```
bash -c "$(curl -fsSL https://cdn.perfbase.com/install.sh)"
```

**Important**: Restart your web server or PHP-FPM service after installation.

### 3. Verify Installation

[](#3-verify-installation)

```
