Before installing and using RabbitStream, ensure your system meets the following requirements.
- PHP 8.1 or higher is required
- A 64-bit build is required
Verify your PHP version and integer width:
php -v
php -r 'echo PHP_INT_SIZE === 8 ? "64-bit OK\n" : "32-bit: unsupported\n";'Stream offsets, timestamps and chunk sizes are uint32/uint64 on the wire. A
32-bit build cannot represent them as integers — unpack() returns floats above
PHP_INT_MAX — so rather than return offsets that are quietly wrong, the library
throws UnsupportedPlatformException as soon as it is asked to decode anything.
The following extension must be enabled in your PHP installation:
| Extension | Purpose | Check Command |
|---|---|---|
mbstring |
String encoding and manipulation | php -m | grep mbstring |
Check the required extension:
php -m | grep mbstringmbstring is typically enabled by default in most PHP installations. If missing, install it:
Ubuntu/Debian:
sudo apt-get install php-mbstringCentOS/RHEL/Fedora:
sudo yum install php-mbstringmacOS (Homebrew):
brew install php
# Extensions are typically included- RabbitMQ 3.9 or higher with the
rabbitmq_streamplugin enabled
The RabbitMQ Stream protocol is not enabled by default. You must enable the rabbitmq_stream plugin:
rabbitmq-plugins enable rabbitmq_streamOr using Docker (see below), the plugin is enabled automatically via the startup command.
- Port 5552 must be open for the RabbitMQ Stream protocol
- The connection is TCP-based and uses binary framing
- Default port can be changed in RabbitMQ configuration if needed
RabbitMQ ships with default credentials for development:
- Username:
guest - Password:
guest - Virtual Host:
/
For production, create dedicated users with appropriate permissions.
The easiest way to get RabbitMQ running locally is with Docker:
The project includes a docker-compose.yml file:
services:
rabbitmq:
image: rabbitmq:4-management
ports:
- "5552:5552" # Stream protocol
- "5672:5672" # AMQP protocol
- "15672:15672" # Management UI
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
command: >
sh -c "rabbitmq-plugins enable rabbitmq_stream && rabbitmq-server"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
interval: 5s
timeout: 10s
retries: 10
start_period: 20sStart RabbitMQ:
docker compose up -dWait for the health check to pass (about 20-30 seconds):
docker compose psAccess the management UI at http://localhost:15672 (guest/guest).
If you prefer not to use Docker Compose:
docker run -d \
--name rabbitmq \
-p 5552:5552 \
-p 5672:5672 \
-p 15672:15672 \
-e RABBITMQ_DEFAULT_USER=guest \
-e RABBITMQ_DEFAULT_PASS=guest \
rabbitmq:4-management \
sh -c "rabbitmq-plugins enable rabbitmq_stream && rabbitmq-server"- RabbitMQ Streams store messages on disk, not in memory
- However, consumers may buffer messages in memory
- Large message batches can increase memory usage
For development:
- Minimum RAM: 512MB for RabbitMQ container
- PHP memory_limit: 128MB or higher
For production:
- RAM: 2GB+ depending on throughput
- Disk: SSD recommended for stream storage
- Network: Low latency connection between PHP and RabbitMQ
Run this PHP script to verify all requirements are met:
<?php
// Check PHP version
if (version_compare(PHP_VERSION, '8.1.0', '<')) {
echo "ERROR: PHP 8.1+ required. Current: " . PHP_VERSION . "\n";
exit(1);
}
echo "PHP Version: " . PHP_VERSION . " OK\n";
// Check required extensions
$required = ['mbstring'];
foreach ($required as $ext) {
if (!extension_loaded($ext)) {
echo "ERROR: Extension '{$ext}' is not loaded\n";
exit(1);
}
echo "Extension '{$ext}': OK\n";
}
echo "\nAll requirements met!\n";Save as check-requirements.php and run:
php check-requirements.phpOnce requirements are verified, proceed to Installation.