简体   繁体   中英

zmq not works in django + apache + mod_wsgi

I have deployed a django project in apache with mod_wsgi.so in windows server ( python2.7 32-bit, apache2.2 32-bit, windows server 64-bit ). I import zmq, and it works well in django project. But within apache, the whole project crash... If I delete "import zmq", the project can work in apache. It seems that there is something wrong between mode_wsgi and zmq.

I fixed this bug. Firstly I traced the error in apache's error log, and found that it was windows error 126 and in zmq's initialization: init .py when loading libsodium

[Thu May 05 20:16:22 2016] [error] import zmq [Thu May 05 20:16:22 2016] [error] File "D:\\Program Files\\python27\\lib\\site-packages\\zmq\\__init__.py", line 42, in [Thu May 05 20:16:22 2016] [error] _libsodium = ctypes.cdll.LoadLibrary(bundled_sodium[0]) [Thu May 05 20:16:22 2016] [error] File "D:\\Program Files\\python27\\Lib\\ctypes\\__init__.py", line 443, in LoadLibrary [Thu May 05 20:16:22 2016] [error] return self._dlltype(name) [Thu May 05 20:16:22 2016] [error] File "D:\\Program Files\\python27\\Lib\\ctypes\\__init__.py", line 365, in init [Thu May 05 20:16:22 2016] [error] self._handle = _dlopen(self._name, mode) [Thu May 05 20:16:22 2016] [error] WindowsError: [Error 126]

so I add

 from . import libsodium, libzmq 

to init .py, and it works well

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM