Skip to content

Installation

Muhammet Şafak edited this page Jun 9, 2026 · 1 revision

Installation

Requirements

PHP 8.2 or newer
Core dependency babelqueue/php-sdk ^1.0 (installed automatically)
ext-json required (bundled with PHP)
ext-pcntl optional — enables graceful SIGINT/SIGTERM shutdown

Plus the client for the broker you choose (see below).

Install

composer require initphp/queue

Then add the client for your transport:

# Database (PDO) — nothing extra beyond ext-pdo
# Redis 6.2+
composer require predis/predis
# RabbitMQ
composer require php-amqplib/php-amqplib
Transport Needs Notes
PDO (Database) ext-pdo Works on MySQL and SQLite. No broker process to run.
Redis predis/predis Redis 6.2+ (uses BLMOVE). Pure-PHP client, no extension needed.
RabbitMQ php-amqplib/php-amqplib Also needs ext-sockets (a dependency of php-amqplib).

Verify the install

require 'vendor/autoload.php';

$transport = new InitPHP\Queue\Transport\Pdo\PdoTransport(new PDO('sqlite::memory:'));
$transport->createSchema();

(new InitPHP\Queue\Producer\Producer($transport, 'demo'))
    ->send('urn:demo:hello', ['who' => 'world']);

echo "ok\n";

The worker CLI

The package ships an executable at vendor/bin/queue. Confirm it is available:

php vendor/bin/queue work
# prints the usage banner

See The Worker for how to drive it with a bootstrap file.

Next

Clone this wiki locally