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:

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 handle profiling automatically, so every HTTP request, queue job, and CLI command is profiled with no code changes.

Pick your framework:

Laravel

composer require perfbase/laravel

Add to your .env:

PERFBASE_ENABLED=true
PERFBASE_API_KEY=your-api-key

Add the middleware to your application, and you’re done. 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)%'

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

WordPress

composer require perfbase/wordpress

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/perfbase-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