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

v0.3.0(10mo ago)01.2k1Apache-2.0PHPPHP &gt;=7.4 &lt;8.5CI passing

Since Nov 7Pushed 10mo 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 1mo ago

READMEChangelog (10)Dependencies (4)Versions (24)Used By (1)

Perfbase PHP SDK
================

[](#perfbase-php-sdk)

[![Packagist License](https://camo.githubusercontent.com/bd1900c86ff4815fcb0198537d45251cd15e80e6aad8299c8ee7b7975d3fdfbc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70657266626173652f7068702d73646b)](https://camo.githubusercontent.com/bd1900c86ff4815fcb0198537d45251cd15e80e6aad8299c8ee7b7975d3fdfbc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70657266626173652f7068702d73646b)[![Packagist Version](https://camo.githubusercontent.com/5440938f33a236326710ab6e3f592e0df394c340b29d5ac6f4968f9e4981eaa1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70657266626173652f7068702d73646b)](https://camo.githubusercontent.com/5440938f33a236326710ab6e3f592e0df394c340b29d5ac6f4968f9e4981eaa1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70657266626173652f7068702d73646b)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/df9f4e692697748cab9cc4b260f7d40a8b9d1e98caaaff6cc062dff9543c2b5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70657266626173656f72672f7068702d73646b2f63692e796d6c3f6272616e63683d6d61696e)](https://camo.githubusercontent.com/df9f4e692697748cab9cc4b260f7d40a8b9d1e98caaaff6cc062dff9543c2b5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70657266626173656f72672f7068702d73646b2f63692e796d6c3f6272616e63683d6d61696e)

A comprehensive PHP SDK for application performance monitoring (APM) and profiling with Perfbase. This SDK provides real-time performance insights, distributed tracing, and detailed profiling capabilities for PHP applications.

Important: Using a PHP Framework?
---------------------------------

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

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

- **Laravel**: Use `perfbase/laravel` for automatic integration with Laravel applications
- **Symfony**: Coming soon
- **Other frameworks**: This SDK provides the foundation for custom integrations

If you're **NOT using a framework** or need **custom integration** - this is the SDK 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.4`
- **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
```

### 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)

```
