Installing zeromq on Windows 7 WAMP server

I am looking for installing zeromq on my Windows 7 machine for using zeromq with PHP (I am using WAMP server (5.3.4), Apache Server 2.2.17).

I followed the documentation on their site, but I don't know what to do. I installed the zeromq from the following site, then I tried to copy the dll from this site but it's down.

Where can I get the DLL? Am I want to install only the Windows installer from from this link, or is there anything else needed?

I have downloaded the dll from this site http://178.79.157.189/~mikko/win32/php-zmq-win32.zip


I'm using PHP 5.3.4 x64 version and Windows 7 x64. I tried the following steps:

  1. I have installed ZeroMQ-3.2.2rc2~miru1.5-x64

  2. copied libzmq.dll to c:\wamp\bin\php\php5.3.4

  3. copied php-zmq\php53\php53-ts_zeromq-3.2.2 to c:\wamp\bin\php\php5.3.4\ext

  4. enabled the php_zmq extension in php.ini

  5. I restarted the WAMP. It shows

    'c:/wamp/bin/php/php5.3.4/ext/php_zmq.dll' - %1 is not a valid win32 application

What could be the problem?

Again I tried with the Wamp x86(php 5.4.3) version and windows 7 x64

  1. I have installed ZeroMQ-3.2.2rc2~miru1.5-x86.exe

  2. copied libzmq.dll to c:\wamp\bin\php\php5.4.3

  3. copied php-zmq\php54\php54-ts_zeromq-3.2.2 to c:\wamp\bin\php\php5.4.3\ext

  4. enabled the php_zmq extension in php.ini

  5. I restarted the WAMP. It shows

    PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_zmq.dll' - The specified module could not be found.\r\n in Unknown on line 0


Given that this is the top search result on Google for zeromq dll problems with PHP on windows, i'm adding my two cents to it.

Proper Steps to setting up zeroMQ with PHP:

1) Download the correct DLL package for PHP

DLL Download Page for PHP ZeroMQ is now found at http://pecl.php.net/package/zmq (http://snapshot.zeromq.com is dead) A tiny 'DLL' link will be present beside each 'available release'. That's your link. Click on it, and select your dll based on your PHP version and whether it's thread Safe (TS) or Non-thread Safe (NTS).

If you are coming from the XAMPP Package, your DLL should be TS & x86 version.

2) Make sure you have the correct Microsoft Visual C++ Redistributable Package installed.

As of this writing, the correct version is the 2012 one. Link to download Package: http://www.microsoft.com/en-us/download/details.aspx?id=30679

3) Copy the phpzmq.dll & libzmq.dll (from the dll package in step 1) to your PHP\Extensions Directory (Default XAMPP php ext path is: C:\xampp\php\ext)

4) Add the phpzmq.dll to your PHP.ini

5) Add the PHP\extensions directory to your PATH system environment variables (very important) & restart your machine

Upon restart, start your apache & pray to the PHP gods.

FAQ for common errors:

1) I have a popup saying "'libzmq.dll' is missing from my computer" when starting apache.

Well darn, make sure you followed step 5 to the letter and verify that the directory path is correct and the dll is present in that directory.

2) Another popup saying "'php5.dll' is missing from my computer" when starting apache.

Looks like you got the wrong dll for your php version. Download the correct one from step 1.

3) A random popup appeared saying "'phpzmq.dll' is not a valid win 32 application."

That DLL is still not correct. Make sure you got the right one (x86 or x64) and that it is either thread safe or non-thread safe. How would you know? Time to play DLL roulette.

Hoping this post actually helps the users who land here :)


@Mysteryos's answer is quite informative but it is inaccurate. There are few mistakes in step 3 & 4 worth to mention.

Correct procedure in WAMP server
Step 3)

  • i) Copy libzmq.dll to php bin root directory (eg. C:\wamp\bin\php\php5.5.12)
  • ii) Copy php_zmq.dll to php extensions directory (eg. C:\wamp\bin\php\php5.5.12\ext)
  • I am using the php_zmq-1.1.2-5.5-ts-vc11-x64.zip (php 5.5, thread safe) which can obtain from this link http://pecl.php.net/package/zmq.
  • Make sure you download the one which match your php version (5.x), else you will get "Another popup saying "'php5.dll' is missing from my computer" when starting apache" error


Step 4)
Add the phpzmq.dll declaration to your PHP.ini

It is important to notice that there are few php.ini in WAMP server directory.
The correct php is in C:\wamp\bin\apache\apache2.4.9\php.ini
Append the following declaration into the php.ini mentioned above.

[ZMQ]
extension=php_zmq.dll

I had the same problem. Using dll from php-zmq_zeromq-{version}-zts folder fixed the problem for me.