ZeroMQ is a software library that lets you quickly design and implement a fast message-based applications

Maintainers

Package info

github.com/chrisBirmingham/phpzmq

Language:C

Type:php-ext

Ext name:ext-zmq

pkg:composer/intermaterium/phpzmq

Statistics

Installs: 16

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.4 2026-06-02 17:54 UTC

This package is auto-updated.

Last update: 2026-06-02 22:52:35 UTC


README

PHP bindings for 0MQ. The documentation is available here

This is a hardfork of the PHP Extension, updated for a PHP's newer extension sensibilities and API functions. As such, support for versions of PHP older than 8.1 and versions of libzmq below version 4 have been dropped.

Additionally the support for libczmq has been dropped as it wasn't documented and wasn't used at $work. Will be added back at a later date should it be required.

Prerequisites

  • libzmq 4.0.0 and above
  • PHP 8.1 and above

Insallation (PIE)

You can install this extension using PIE

pie install intermaterium/phpzmq

Installation (Build from source)

You can also use the old phpize method to install the extension

git clone --recursive --depth=1 https://github.com/chrisBirmingham/phpzmq.git
cd phpzmq
phpize
./configure
make
make install

The API is roughly as follows:

<?php

/* Create new queue object */
$queue = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REQ, "MySock1");

/* Connect to an endpoint */
$queue->connect("tcp://127.0.0.1:5555");

/* send and receive */
var_dump($queue->send("hello there, using socket 1")->recv());

?>