Install AMQP in windows 10 & PHP 7.3
Asked Answered
N

5

5

i want to install AMQP in windows 10 with PHP 7.3 for use in symfony 4. windows not use any apache/iis/nginx and run directly by symfony.

everything ok! until, i decide to use rabbitmq in project and need amqp for it.

So, 1. download AMQP 1.9.4 (php 7.3 compatible)
2. copy php_amqp.dll to c:\php
3. copy rabbitmq.4.dll (AMQP 1.9.4 compatible) to c:\windows\system32
4. add extension=php_amqp.dll > php.ini
5. php.ini extension_dir = "ext"

but i get this error:

PHP Warning:
PHP Startup: Unable to load dynamic library 'php_amqp.dll'
(tried: ext\php_amqp.dll (The specified module could not be found.),
ext\php_php_amqp.dll.dll (The specified module could not be found.)) in Unknown on line 0

i try these instruction:
1. change php.ini extension_dir to "C:\php\ext\"
2. install openssl 1.1
3. copy libeay32.dll,ssleay32.dll into "c:\windows\system32"
4. restart, restart, restart, ...

how can i solve this problem?

Nitramine answered 3/3, 2019 at 9:3 Comment(0)
A
8

Try:

  • copying php_amqp.dll and php_amqp.pdb into \php\ext\
  • copying rabbitmq.4.dll and rabbitmq.4.pdb into \php\

It didn't work for me with PHP 7.2.13RC1, but it works with PHP 7.2.17

I'm using Windows 10, x64, PHP non thread safe

Akimbo answered 29/4, 2019 at 16:9 Comment(1)
That was the missing part for me: "copying rabbitmq.4.dll and rabbitmq.4.pdb into \php\"Elnoraelnore
A
2

1) generate phpinfo file, check - Architecture ie: x86 - PHP Extension Build ie: API20170718,TS,VC15 - Thread Safety ie: enabled

2) go to https://pecl.php.net/package/amqp find version of library acording to your PHP ver, and thread safe or not thread safe

like here: https://pecl.php.net/package/amqp/1.9.4/windows

3) unzip/tar package copy php_amqp.dll into ext dir in php dir (ie: c:/xammp/php/ext)

4) edit php.ini add "extension=php_amqp.dll"

copy rabbitmq.4.dll and rabbitmq.4.pdb into ie: c:/xammp/php

5) install Win32OpenSSL (save dlls in windows/system dir)

https://slproweb.com/products/Win32OpenSSL.html

Adown answered 29/1, 2020 at 21:28 Comment(1)
I am on windows 10, I skipped the step 5 and it works fine! thanksHippo
I
1
  1. Be shure you download compatible version php and amqp libriary (thread-save or no9t-thread-safe, x86 or x64).

For example:

links to all versions for windows:

AMQP https://pecl.php.net/package/amqp/1.9.4/windows

PHP https://windows.php.net/download/

  1. You need to register dll regsvr32 c:\windows\system32\rabbitmq.4.dll (or copy rabbitmq.4.dll to c:\php\ dir)

and move php_amqp.dll to extension dir move c:\php\php_amqp.dll c:\php\ext\

Immateriality answered 5/8, 2019 at 8:29 Comment(1)
After running, regsvr32 c:\windows\system32\rabbitmq.4.dll i get the following error. I made sure to use right dlls for my php version and thread safety. The module "c:\windows\system32\rabbitmq.4.dll" was loaded but the entry point DllRegisterServer was not found Make sure that "c:\windows\system32\rabbitmq.4.dll" is a valid DLL or OCX file and then try again.Disembroil
B
1

I had same problem to install amqp with XAMPP(if that is a case) Make sure you downloaded Thread-safe version for amqp Rest of configuration is showed above

  1. Add php_amqp.dll in xampp/php/ext
  2. Add rabbit.dll windows/system32
  3. in php.ini add extension=php_amqp.dll

That's it.

Brotherinlaw answered 22/1, 2021 at 8:42 Comment(0)
Q
1

copy rabbitmq.4.dll to php/ directory. That saved my life with php 8.1.4. First moved it to php/ext and doesn't work

Quarry answered 6/7, 2022 at 19:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.