Skip to main content
Introduction

Getting Started with Perfbase

Get up and running with Perfbase in under 5 minutes.

1. Install the PHP Extension

The Perfbase extension is what does the actual profiling. It hooks into PHP’s engine to measure every function call. Install it with a single command:

Supported PHP versions: 7.4 through 8.5.

Supported platforms:

  • Linux on x86_64 and ARM64
  • macOS on Intel and Apple Silicon

Need another platform or architecture? Contact support and tell us what you’re running.

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

This auto-detects your PHP version, OS, and architecture, then installs and enables the extension. Verify it’s working:

php -m | grep perfbase

2. Create a Project and Get Your API Key

  1. Create a free account
  2. Create an organization and project
  3. Choose the trace storage region that fits your compliance requirements or regional preference
  4. Copy your project API key from Project Settings → API Keys

3. Choose Your Trace Storage Region

Perfbase can store trace data in different parts of the world so teams can align deployments with compliance requirements or internal policy.

Available regions:

Europe

  • 🇫🇷 France
  • 🇩🇪 Germany
  • 🇬🇧 London
  • 🇵🇱 Poland

APAC

  • 🇮🇳 India
  • 🇸🇬 Singapore
  • 🇦🇺 Sydney

America

  • 🇨🇦 Toronto

Choose the region you want before sending production traces so the project’s data lands where you expect it to.

4. Install Your Framework Package

Perfbase has first-party packages for popular PHP frameworks. These wire profiling into each framework’s supported HTTP, command, job, cron, or CLI lifecycle with a small amount of framework-specific setup.

Pick your framework:

Laravel

composer require perfbase/laravel:^1.0

Add to your .env:

PERFBASE_ENABLED=true
PERFBASE_API_KEY=your-api-key
PERFBASE_SAMPLE_RATE=0.1

Add the middleware for HTTP profiling. Queue jobs and Artisan commands are wired through Laravel events. See the full Laravel docs for middleware setup, queue profiling, and configuration options.

Symfony

composer require perfbase/symfony

Configure in config/packages/perfbase.yaml:

perfbase:
    enabled: true
    api_key: '%env(PERFBASE_API_KEY)%'
    sample_rate: 0.1

HTTP requests and console commands are profiled automatically via event subscribers. See the full Symfony docs.

WordPress

composer require perfbase/wordpress:^1.0

Activate the plugin, then configure in Settings → Perfbase with your API key. See the full WordPress docs.

Other Frameworks

We also have packages for CakePHP, Drupal, Slim, Joomla, CodeIgniter 4, Yii 1.1, Yii 2, and Yii 3.

No framework or custom setup?

Use the PHP SDK directly for full manual control:

composer require perfbase/php-sdk
use Perfbase\SDK\Perfbase;
use Perfbase\SDK\Config;

$config = Config::fromArray(['api_key' => 'your-api-key']);
$perfbase = new Perfbase($config);

$perfbase->startTraceSpan('web-request');
// ... your application code ...
$perfbase->stopTraceSpan('web-request');
$perfbase->submitTrace();

5. View Your Traces

Open the Perfbase Console and navigate to your project. Traces appear within seconds of your first profiled request.

Each trace includes a flame graph, function-level timing, database query analysis with N+1 detection, and memory profiling, all from a single extension with zero code instrumentation.

Next Steps