Adding the ZeroMQ PHP extension to XAMPP on Windows 10 and PHP7
Asked Answered
C

2

9

I am having issues adding the ZeroMQ PHP extension to XAMPP.

Setup: Windows 10, PHP7, XAMPP (7.0.9)

Steps I already took:

  1. Added PHP (D:\xampp7\php) and PHP extensions (D:\xampp7\php\ext) directories to system variable (PATH)

  2. Followed the instructions on zeromq.org. I downloaded x86ts version from the pecl repository as the listed snapshot link (http://snapshot.zero.mq/) was down.

  3. Copied libzmq.dll into PHP directory and php_zmq.dll into the PHP extension directory

  4. Updated php.ini (D:\xampp7\php\php.ini) by adding extension=php_zmq.dll and checked the extensions directory which is extension_dir="D:\xampp7\php\ext"

  5. Restarted XAMPP via the control panel.

The Apache error log shows the following:

[Sat Nov 26 18:30:27.461679 2016] [ssl:warn] [pid 15280:tid 588] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Nov 26 18:30:27.546320 2016] [core:warn] [pid 15280:tid 588] AH00098: pid file D:/xampp7/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat Nov 26 18:30:27.630955 2016] [ssl:warn] [pid 15280:tid 588] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\\xampp7\\php\\ext\\php_zmq.dll' - Das angegebene Modul wurde nicht gefunden.\r\n in Unknown on line 0
[Sat Nov 26 18:30:27.662208 2016] [mpm_winnt:notice] [pid 15280:tid 588] AH00455: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/7.0.9 configured -- resuming normal operations
[Sat Nov 26 18:30:27.662208 2016] [mpm_winnt:notice] [pid 15280:tid 588] AH00456: Apache Lounge VC14 Server built: Jul  1 2016 11:09:37
[Sat Nov 26 18:30:27.662208 2016] [core:notice] [pid 15280:tid 588] AH00094: Command line: 'd:\\xampp7\\apache\\bin\\httpd.exe -d D:/xampp7/apache'
[Sat Nov 26 18:30:27.662208 2016] [mpm_winnt:notice] [pid 15280:tid 588] AH00418: Parent: Created child process 964
[Sat Nov 26 18:30:28.363210 2016] [ssl:warn] [pid 964:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

Update:

It looks like the module cannot be found, but if I add the x64 Version the Apache error log indicates that the module is not a not a valid Win32 application.

PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\\xampp7\\php\\ext\\php_zmq.dll' - %1 ist keine zul\xef\xbf\xbdssige Win32-Anwendung.\r\n in Unknown on line 0

Solution:

Adding LoadFile "D:/xampp7/php/libzmq.dll"to httpd.conf fixed my issue.

Conscionable answered 26/11, 2016 at 17:37 Comment(1)
please write answer on the answer section.. but i'm glad you sorted it out.Linette
G
9

these steps worked for me (php 7.1.7 - xampp - window 10 x64)

Step 1

download x86 dll files from this site

Step 2

copy php_zmq.dll to C:\xampp\php\ext

Step 3

copy libsodium.dll and libzmq.dll to C:\xampp\php

Step 4

add extension=php_zmq.dll to php.ini file

Step 5

restart apache

Guardant answered 12/11, 2017 at 6:39 Comment(8)
Yeah I though so too, but I experience that you have to also add the Loadfile ... statement for the libzmq.dllConscionable
I get crash in apache with LoadfileGuardant
Wrong path probably?Conscionable
If it works for you it should not matter, but if the file and path was correct it should not make any problems. See the LoadFile Directive of Apache httpd.apache.org/docs/2.2/mod/mod_so.html#loadfileConscionable
@Guardant How to install in xampp on Mac?Carbide
@Carbide I didn't test it on macGuardant
This Steps are same in all tutorials. I have windows 10, x64 arch, xamp with php 7.2 and follow this steps except Step 3, i only copy libzmq.dll to C:\xampp\php and i added C:\xampp\php\ext to System Enviroment Variables. Try with differents php_zmq.dll files until php -m shows zmq module without warnings. Persevere and you will get itInfamous
@Conscionable +7 votes for this answer. it seems it's right answer for your question. please hit that button :DGuardant
S
2

I know this is an old question although I just spent 2 days trying to get ZeroMQ to load properly. If anyone still cant get it to work after following all the basic instructions, I have 2 more steps you can look into.

Got it working with php 7.3.12, Win10 x64

1st. Make sure you edit all php.ini files.

If you use wamp server, Apache will have it's own php.ini that is opened up when you click on the wamp icon in the bottom right of windows and go to php->php.ini. Then manually add the same extension=php_zmq.dll there as well as your php.ini under D:\xampp7\php\php.ini. To be honest, I'm not 100% sure that this is necessary but including it on both cant hurt.

2nd. Run deplister.exe on libzmq.dll

This is what got it working for me. Any php download from windows.php.net should have deplister.exe (it is included in wamp php versions too). Go to your php version library on your wamp server where libzmq.dll and deplister.exe are located. Then open up cmd and run the line: deplister php_zmq.dll This will show you a list of the dependencies that php_zmq.dll requires to run. You may notice that it requires a VERY specific version of libzmq.dll so go and rename your dll file to the requested file name. Then run php -m to see if zmq is displayed on the list of modules. If so, you should be able to run commands like composer update to get the required library versions imported into your project without error!

Sentimentalize answered 9/8, 2020 at 0:30 Comment(1)
This seems to only work with php7, i have 8 installed and I really don't work to reinstall anything..Do you have any suggestions?Newfashioned

© 2022 - 2024 — McMap. All rights reserved.