Search code examples
apachemod-lua

Symbol not found: _ap_lua_init_mutex when loading mod_lua


I have Apache httpd server installed via Homebrew. I tried compiling mod_lua by running

apxs -i -a -c mod_lua.c 

But httpd is failing to start with error

Cannot load /usr/local/lib/httpd/modules/mod_lua.so into server: dlopen(/usr/local/lib/httpd/modules/mod_lua.so, 10): Symbol not found: _ap_lua_init_mutex\n Referenced from: /usr/local/lib/httpd/modules/mod_lua.so\n Expected in: flat namespace\n in /usr/local/lib/httpd/modules/mod_lua.so

What does the above error mean?


Solution

  • I fixed it by building the module with

    apxs -I/usr/local/include/lua5.3 -i -a -c mod_lua.c lua_*.c -lm  -llua