PHPackages                             php-amqp/php-amqp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. php-amqp/php-amqp

ActivePhp-ext[Queues &amp; Workers](/categories/queues)

php-amqp/php-amqp
=================

PHP AMQP Binding Library

v2.2.0(4mo ago)5855.1k—0.7%122[17 issues](https://github.com/php-amqp/php-amqp/issues)[3 PRs](https://github.com/php-amqp/php-amqp/pulls)PHP-3.01CPHP &gt;=7.4CI passing

Since Jan 27Pushed 1mo ago31 watchersCompare

[ Source](https://github.com/php-amqp/php-amqp)[ Packagist](https://packagist.org/packages/php-amqp/php-amqp)[ Docs](https://github.com/php-amqp/php-amqp)[ GitHub Sponsors](https://github.com/lstrojny)[ RSS](/packages/php-amqp-php-amqp/feed)WikiDiscussions latest Synced 1mo ago

READMEChangelogDependencies (2)Versions (39)Used By (0)

PHP AMQP bindings [![Test](https://github.com/php-amqp/php-amqp/actions/workflows/test.yaml/badge.svg)](https://github.com/php-amqp/php-amqp/actions/workflows/test.yaml)
=========================================================================================================================================================================

[](#php-amqp-bindings-)

Object-oriented PHP bindings for the AMQP C library ()

### Requirements:

[](#requirements)

- PHP &gt;= 7.4 with either ZTS or non-ZTS version.
- Starting with php-amqp 2.0.0 at least version 0.8.0 of [librabbitmq](https://github.com/alanxz/rabbitmq-c) is required (at least 0.10.0 is recommended)
- to run tests [RabbitMQ server](https://www.rabbitmq.com/) &gt;= 3.4.0 required.

### Installation

[](#installation)

#### Linux

[](#linux)

Some systems have php-amqp extension available in their package repositories or available via an external repository so it is MAY be the preferable way to install.

Fresh `php-pecl-amqp` and `librabbitmq` RPMs available via [remi repo](http://rpms.remirepo.net/).

If you want to stay on the bleeding edge and have the latest version, install php-amqp extension from [PECL](http://pecl.php.net/package/amqp) or compile from sources (follow [PHP official docs instruction](http://us1.php.net/manual/en/install.pecl.phpize.php)).

#### Windows

[](#windows)

- Before download, check if your PHP installation is thread safe or non-thread safe by entering php -i|findstr " Thread" in your terminal
- Download thread safe or non-thread safe version of the extension for your PHP version from . Look for the "DLL" link next to each release in the list of available releases
- After download, copy the `rabbitmq.4.dll` and `rabbitmq.4.pdb` files to the PHP root folder and copy `php_amqp.dll`and `php_amqp.pdb` files to `PHP\ext` folder
- Add `extension=amqp` to the `php.ini` file
- Check if the module is properly installed with php -m

### Documentation

[](#documentation)

Check out the official [RabbitMQ tutorials](http://www.rabbitmq.com/getstarted.html)as well as the [php-amqp specific examples](https://github.com/rabbitmq/rabbitmq-tutorials/tree/main/php-amqp).

There are also [stub files](https://github.com/php-amqp/php-amqp/tree/latest/stubs) available that document the API of PHP AMQP. These stubs can also be used in your IDE for code completion, navigation and documentation.

Check out the [upgrading guide](https://github.com/php-amqp/php-amqp/tree/latest/UPGRADING.md) to check breaking changes between versions, e.g. from 1.x to 2.x.

Finally, check out the [tests](https://github.com/php-amqp/php-amqp/tree/latest/tests) to see usage examples and edge cases.

### Notes &amp; limitations

[](#notes--limitations)

- You can't share any of AMQP API objects (`AMQPConnection`, `AMQPChannel`, `AMQPQueue`, `AMQPExchange`) between threads. Use a separate connection per thread.
- There may only be one persistent connection per [connection information](https://github.com/search?q=repo%3Aphp-amqp%2Fphp-amqp+amqp_conn_res_h&type=code). If there will be an attempt to create another persistent connection with the same credentials, an exception will be thrown.
- Channels on persistent connections are not persistent: they are destroyed between requests.
- Heartbeats are limited to blocking calls only, so if there are no any operations on a connection or no active consumer set, connection may be closed by the broker as dead.

### Related libraries

[](#related-libraries)

- [enqueue/amqp-ext](https://github.com/php-enqueue/amqp-ext) is an [amqp interop](https://github.com/queue-interop/queue-interop#amqp-interop) compatible wrapper
- [symfony/amqp-messenger](https://symfony.com/components/AMQP%20Messenger) provides AMQP integration for [symfony/messenger](https://symfony.com/doc/current/messenger.html), the popular messaging component by Symfony.

### How to report a problem

[](#how-to-report-a-problem)

1. First, search through the closed issues and [stackoverflow.com](http://stackoverflow.com).
2. Submit an issue with short and definitive title that describe your problem
3. Provide platform info, PHP interpreter version, SAPI mode (cli, fpm, cgi, etc) the extension is used in, php-amqp extension version, librabbitmq version, make tools version.
4. Description should provide information on how to reproduce a problem ([gist](https://gist.github.com/) is the most preferable way to include large sources) in a definitive way. Use [Vagrant](http://www.vagrantup.com/) to replicate unusual environments.
5. If stack trace is generated, include it in full via [gist](https://gist.github.com/) or the important part (if you definitely know what you are doing) directly in the description.

#### Things to check before reporting a problem

[](#things-to-check-before-reporting-a-problem)

Some of them, the list is not complete.

1. You are running on correct machine in correct environment and your platform meets your application requirement.
2. librabbitmq is installed and discoverable in your environment so php-amqp extension can load it.
3. php-amqp extension present in system (find `amqp.so` or `amqp.dll` if you are on windows), it is loaded (`php --ri amqp` produced some info), and there are no underlying abstraction that MAY emulate php-amqp work.
4. You hav correct RabbitMQ credentials.
5. You are using the latest php-amqp, librabbitmq, RabbitMQ and sometimes PHP version itself. Sometimes your problem is already solved.
6. Other extensions disabled (especially useful when PHP interpreter crashes, and you get a stack trace and segmentation fault).

Development
-----------

[](#development)

See [DEVELOPMENT.md](DEVELOPMENT.md) for details.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity49

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~121 days

Recently: every ~216 days

Total

34

Last Release

137d ago

Major Versions

v1.11.0 → v2.0.0alpha12023-07-29

PHP version history (4 changes)v1.6.0beta2PHP &gt;=5.2.0

v1.6.0beta4PHP &gt;=5.3.0

v1.10.0PHP &gt;=7.1

v2.0.0alpha1PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/79707?v=4)[Lars Strojny](/maintainers/lstrojny)[@lstrojny](https://github.com/lstrojny)

---

Top Contributors

[![lstrojny](https://avatars.githubusercontent.com/u/79707?v=4)](https://github.com/lstrojny "lstrojny (306 commits)")[![pinepain](https://avatars.githubusercontent.com/u/2185793?v=4)](https://github.com/pinepain "pinepain (98 commits)")[![bkw](https://avatars.githubusercontent.com/u/60910?v=4)](https://github.com/bkw "bkw (79 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (41 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (17 commits)")[![weltling](https://avatars.githubusercontent.com/u/22016?v=4)](https://github.com/weltling "weltling (15 commits)")[![sqmk](https://avatars.githubusercontent.com/u/279474?v=4)](https://github.com/sqmk "sqmk (13 commits)")[![narkq](https://avatars.githubusercontent.com/u/705650?v=4)](https://github.com/narkq "narkq (11 commits)")[![pdezwart](https://avatars.githubusercontent.com/u/959860?v=4)](https://github.com/pdezwart "pdezwart (9 commits)")[![cmb69](https://avatars.githubusercontent.com/u/2306138?v=4)](https://github.com/cmb69 "cmb69 (6 commits)")[![flavioheleno](https://avatars.githubusercontent.com/u/471860?v=4)](https://github.com/flavioheleno "flavioheleno (3 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (3 commits)")[![xodmqjw](https://avatars.githubusercontent.com/u/33238493?v=4)](https://github.com/xodmqjw "xodmqjw (2 commits)")[![andrew-demb](https://avatars.githubusercontent.com/u/12499813?v=4)](https://github.com/andrew-demb "andrew-demb (2 commits)")[![empi89](https://avatars.githubusercontent.com/u/158283?v=4)](https://github.com/empi89 "empi89 (2 commits)")[![Jan-E](https://avatars.githubusercontent.com/u/1757825?v=4)](https://github.com/Jan-E "Jan-E (2 commits)")[![kinncj](https://avatars.githubusercontent.com/u/292542?v=4)](https://github.com/kinncj "kinncj (2 commits)")[![petk](https://avatars.githubusercontent.com/u/1614009?v=4)](https://github.com/petk "petk (2 commits)")[![prolic](https://avatars.githubusercontent.com/u/394428?v=4)](https://github.com/prolic "prolic (2 commits)")[![siad007](https://avatars.githubusercontent.com/u/2149445?v=4)](https://github.com/siad007 "siad007 (2 commits)")

---

Tags

messagequeuerabbitmqAMQP

###  Code Quality

Code StyleECS

### Embed Badge

![Health badge](/badges/php-amqp-php-amqp/health.svg)

```
[![Health](https://phpackages.com/badges/php-amqp-php-amqp/health.svg)](https://phpackages.com/packages/php-amqp-php-amqp)
```

###  Alternatives

[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.3k20.1M65](/packages/php-amqplib-rabbitmq-bundle)[bunny/bunny

Performant pure-PHP AMQP (RabbitMQ) non-blocking ReactPHP library

7426.5M37](/packages/bunny-bunny)[pdezwart/php-amqp

PHP AMQP Binding Library

585242.0k2](/packages/pdezwart-php-amqp)[kdyby/rabbitmq

Integrates php-amqplib with RabbitMq and Nette Framework

30693.1k4](/packages/kdyby-rabbitmq)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
