Installing php_zmq zeromq on XAMPP with PHP 5.6 as a service


#1

Hello

  • I have E:\XAMPP with PHP 5.6.15 running on Windows Server 2012 R2 Std
  • I have E:\xibo (1.8.0) along with SymlinkD referencing E:\XAMPP\htdocs\xibo to E:\xibo\web
  • Following posts on the Internet I have downloaded .dll’s from PECL at http://windows.php.net/downloads/pecl/releases/zmq/1.1.2/php_zmq-1.1.2-5.6-ts-vc11-x64.zip and placed them in the following locations as well as I unblocked them in their file properties:
    E:\XAMPP\php\ext\php_zmq.dll
    E:\XAMPP\php\libzmq.dll
    and entered an extensions line in my E:\XAMPP\php\php.ini:
    extension=php_zmq.dll
    I restart Apache and continue to get the “!” in the server requirements check of the installation for ZeroMQ as well as the following entry in my PHP log:
 PHP Warning:  PHP Startup: Unable to load dynamic library '\xampp\php\ext\php_zmq.dll' - %1 is not a valid Win32 application.
 in Unknown on line 0

Everything else in the requirements checks out fine, I have tried variations of the above, trying different version .dlls (as well as architecture), I have placed this dll in the root E:\XAMPP\libzmq.dll, I have added php to my server path. Nothing seems to change and I continue to get the same error and behavior.

Any help getting ZeroMQ going appreciated, thank you.


Mcrypt & ZeroMQ missing
How to fix this?please help
ZeroMQ on Windows Server 2016 not working
ZeroMq on windows server
Xmr disconnected
#2

I had the same issue and the following got it sorted.

I downloaded http://pecl.php.net/package/zmq/1.1.2/windows “5.6 Thread Safe (TS) x86” version.
Copy the php_zmq.dll to php/ext directory as you did before

Then copy the libzmq.dll to the xamp/ root directory, not the PHP

RESTART apache.


#3

Thank you but that variation I already tried - I did say same error but in fact when I use the x86 architechture dlls or either of the 1.1.3 -7.x versions I do get a slightly different error:

 PHP Warning:  PHP Startup: Unable to load dynamic library '\xampp\php\ext\php_zmq.dll' - The specified module could not be found.
  in Unknown on line 0

not sure why the 5.6 or 5.5 x64 .dlls would be found and provide the “…not a valid Win32 application…” message while the x86 exact same files result in “…The specified module could not be found…

still at a loss.


#4

I have exactly the same problem.
I have already tried everything

No one has a solution???

Windows Server 2008 R2
PHP Version 5.6.30
XAMPP


#5

May try install VS2010 C++ redistributable

Reference: http://stackoverflow.com/questions/4718262/zeromq-dllnotfoundexception-using-net-bindings

Sorry, try Visual Studio 2013 C++ redistributable

Depending on your OS and version of zeroMQ you may need a different version of the Visual Studio C++ redistributable.
Reference: http://zeromq.org/distro:microsoft-windows


#6

I’ve also tried everything including copy libzmq.dll to C:/Xampp, C:/Xampp/php, C:/Windows/system32, adding all these folder to windows path, adding Fileload “C:/Xampp/php/libzmq.dll” in httpd.conf, but nothing works.

Hope someone can answer this.

By the way, I think it’s much more difficult and complicated to install xibo via docker in Windows than custom installation…(except the zeromq issue)

P.S. My environment is Windows 10 x64
+ Xampp 5.6.30
+ libzmq 1.1.2 (both ts and nts)


#7

This is exactly how it works under Windows 10 Home (32 bit)
PHP 5.6.30 (VC11 X86 32bit thread safe) + PEAR


#8

I have tried quite a few things like newer Xampp and see if works on Win10

I get it to work on Windows 10 with Xampp 5.6.30 and php_zmq-1.1.2-5.6-ts-vc11-x86
but the same setup on Server 2012 r2 Std gives the following message:

PHP Warning: PHP Startup: zmq: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0

Regarding either version Xampp I tried, my Windows 10 machine has the following VC:

Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
Microsoft Visual C++ 2010 x64 Redistributable 10.0.40219
Microsoft Visual C++ 2010 x86 Redistributable 10.0.40219
Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.30501
Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23918
Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.23918
Microsoft Visual C++ Redistributable
Microsoft Visual C++ Redistributable

My Server 2012 r2 Std has the following VC:

Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2005 Redistributable (x64)
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.17
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161
Microsoft Visual C++ 2010 x64 Redistributable 10.0.40219
Microsoft Visual C++ 2010 x86 Redistributable 10.0.40219
Microsoft Visual C++ 2012 Redistributable (x64) - 11.0.61030
Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030
Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.30501
Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.24123
Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24123

Not sure I am missing any, unless there is a specific version needed - but then why isn’t that posted on the PECL download site.


#9

Windows 10 Home (32 bit)


#10

Is it possible that all the successful trying are in x86(32bits) Windows?
Does anyone have success on 64bits Windows?


#11

Update:

  • Successful with Xampp running Apache as process (my Windows 10 tests were this way, my server 2012 also tests true this way)
  • Still Failure with Xampp running Apache as service (my original server installation was running this way, so I was always getting the failure)

Details:

Windows Server 2012 r2 Std
xampp-portable-win32-5.6.28-1-VC11
php_zmq-1.1.2-5.6-ts-vc11-x86 (…\XAMPP\php\ext\php_zmq.dll & …\XAMPP\libzmq.dll)
xibo-cms-1.8.1

If I just start Apache without it being set to run as a service, ZeroMQ comes up saying it is good on the Requirements Check however if I set Apache to be run as a service in Xampp then start it, ZeroMQ comes up with “!” Status on the Requirements Check.

It is only a problem when Apache is run as a service - but what the heck… There are two Windows Event log errors:

The description for Event ID 4 from source PHP-5.6.28 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

php[4704]
PHP Warning: PHP Startup: Unable to load dynamic library ‘\XAMPP\php\ext\php_zmq.dll’ - The specified module could not be found.
(E:\xampp\apache\bin\httpd.exe -d E:/XAMPP/apache)

and the next exactly the same except the end:

php[5320]
PHP Warning: PHP Startup: Unable to load dynamic library ‘\XAMPP\php\ext\php_zmq.dll’ - The specified module could not be found.
(“E:\xampp\apache\bin\httpd.exe” -k runservice)

I need it to run as a service - I still cannot figure this out, not sure why it does not find the .dll when run as a service but will when not.


#12

And if Xibo then depends in the future on something like ElasticSearch, or memcached or redis, then would it still be simpler to do a custom install? In the long term, you’re going to have a worse experience persisting with a custom install in my opinion.


#13

Same problem with Windows 10 when Apache on Xampp run as Service:

Windows 10 1607
xampp-portable-win32-5.6.28-1-VC11
php_zmq-1.1.2-5.6-ts-vc11-x86 (…\XAMPP\php\ext\php_zmq.dll & …\XAMPP\libzmq.dll)
xibo-cms-1.8.1

Don’t know why Apache as process can see php_zmq.dll but Apache as service cannot.
I have even tried modifying all paths in php.ini to be static in case running as a service didn’t like the dynamic paths.
Any ideas out there why this specific .dll cannot be found when Apache is running as a service?


#14

Well, may all my unseen fist pounding help others in this scenario:

When Apache is run as a service in Xampp, it requires the libzmq.dll in a different location than when run as a process.
Procmon showed a few places it looks for it (per Procmon, apparently it really was finding php_zmq.dll and therefore providing a misleading error when libzmq.dll was not found), however for Xampp only these two would suffice:

\XAMPP\apache\libzmq.dll
\XAMPP\apache\bin\libzmq.dll

I chose \XAMPP\apache\ because it is just cleaner and easier to see it there.

So for success running as a process or as a service, the following is my resultant set:

Windows Server 2012 r2 Std
xampp-portable-win32-5.6.28-1-VC11
php_zmq-1.1.2-5.6-ts-vc11-x86 (…\XAMPP\php\ext\php_zmq.dll & …\XAMPP\libzmq.dll…& …\XAMPP\Apache\libzmq.dll - all files unblocked in properties after download)
\XAMPP\php\php.ini with extension=php_zmq.dll
xibo-cms-1.8.1
VC++ Redistributable of 2012 or 2015 (x86 & x64) might play a hand if you have similar struggles, I couldn’t pin enough of that one down to be sure (not going to go uninstall any of them now just to try and find out)

and I’m done with this :slight_smile:


How to install ZeroMQ for windows server 2012 and Webserver XAMPP
#15

Thank you for your detailed instructions! I’ve gotten my XMR working with them.

Just to add to this a little bit, it’s VC++2012 that is needed. The “vc11” in the name of the ZMQ file refers to VC++ 2012. VC++2015 is otherwise know as vc14, so if a future version of ZMQ has “vc14” in the file name, we’ll all need to install VC++ 2015. That said, I don’t know if it’s the x86 or x64 version of 2012 that ZMQ is using, I installed both rather than monkey around with it.

On top of that, the VC++ 2012 redistributable package link on Microsoft’s site is broken. Judging from technet community posts, it has been for a while. To get a copy I had to go to MS’s VC++ community site at https://www.visualstudio.com/dev-essentials/ and sign up for a free account to be able to get the 2012 installers.


#16

Glad to have provided and glad you found a way to get what you needed, thanks for sharing.

*Interesting that my Win10 does not appear to have VC++ 2012 installed yet it worked fine with the vc11 ZMQ files, perhaps it is a minimum level and not absolute.