DEV Community

Marcos Rezende
Marcos Rezende

Posted on

How to install amqp extension for PHP on Windows

Warning: before the download, check if your PHP installation is thread safe or non-thread safe typing this on Terminal:

php -i|findstr "Thread"

Next, proceed:

  1. Download the right version of the extension https://pecl.php.net/package/amqp
  2. After download, copy rabbitmq.4.dll and rabbitmq.4.pdb files to PHP root folder and copy php_amqp.dll and php_amqp.pdb files to PHP\ext folder
  3. Add extension=amqp to the php.ini file
  4. Check if is everything OK with php -m

It is miserable easy but I have stuck on this for almost two hours.

Top comments (8)

Collapse
 
gmormorromrom profile image
r0mdhan

sometimes many problems appears when you install php_amqp.dll and abbitmq.4.dll
I make a solution with an example for xampp environnement
you need to pass variable environment PATH with c:\xampp\php
and make rabbitmq.4.dll in C:\xampp\php and php_amqp.dll in C:\xampp\php\ext
take a look in C:\xampp\php\logs\php_error_log for detected if there is some problems.
you need to restart xampp program not service but all the program with quit button to take variable environment .

Collapse
 
whatshells profile image
NotTheBestWay • Edited

This how to is not working for xampp with php 8.2.
If you do it like this how to you get an error:

PHP Warning: PHP Startup: Unable to load dynamic library 'amqp' (tried: C:\xampp\php\ext\amqp

Is there anybody who knows how to solve this Problem?

Collapse
 
alaindet profile image
Alain D'Ettorre

Thanks!

Collapse
 
seovalencia profile image
Carlos Fabuel Cava

I suppose this is right for <php 8.0

Collapse
 
stepanot profile image
stephanie

do you know how to do it for php 8.0? I've been trying all day

Collapse
 
demi_god profile image
Demi God

Has anyone done on php 8+ versions? I'm stuck..

Collapse
 
10thdoctor profile image
Davide Preti

Thnaks you Rezende,
I've been looking for a tutorial like yours for the whole afternoon.

Collapse
 
blacksheep profile image
Vũ Huy Hưng

You save my life!