lighttpd-for-windows win7 运行的错误处理

本文详细介绍了lighttpd-for-windows在Win7系统上的安装过程及遇到的错误处理方法,包括下载、配置及解决常见问题。
lighttpd-for-windows win7 运行的错误处理


1. 下载
http://kevinworthington.com/lighttpd-for-windows/




2. 报错
C:\lighttpd\sbin>lighttpd.exe -f ..\etc\lighttpd.conf
      1 [main] lighttpd 7804 child_copy: linked dll data write copy failed, 0x37
8000..0x37A5B0, done 0, windows pid 2681556, Win32 error 87


3. cygwin 不兼容列表
 https://cygwin.com/faq/faq.html#faq.using.bloda


Windows Defender 赫然在列, 该服务停掉就OK了





解释一下这个函数 int plugins_load(server *srv) { ck_realloc_u32(&srv->plugins.ptr, 0, srv->srvconf.modules->used, sizeof(plugin *)); buffer * const tb = srv->tmp_buf; #ifdef _WIN32 int (WINAPI *init)(plugin *pl); #else int (*init)(plugin *pl); #endif for (uint32_t i = 0; i < srv->srvconf.modules->used; ++i) { const buffer * const module = &((data_string *)srv->srvconf.modules->data[i])->value; void *lib = NULL; /* check if module is built-in to main executable */ buffer_clear(tb); buffer_append_str2(tb, BUF_PTR_LEN(module), CONST_STR_LEN("_plugin_init")); #ifdef _WIN32 init = (int(WINAPI *)(plugin *))(intptr_t) GetProcAddress(GetModuleHandle(NULL), tb->ptr); #else init = (int (*)(plugin *))(intptr_t)dlsym(RTLD_DEFAULT, tb->ptr); #endif if (NULL == init) { buffer_copy_string(tb, srv->srvconf.modules_dir); buffer_append_path_len(tb, BUF_PTR_LEN(module)); #ifdef _WIN32 buffer_append_string_len(tb, CONST_STR_LEN(".dll")); if (NULL == (lib = LoadLibrary(tb->ptr))) { if (srv->srvconf.compat_module_load) { if (buffer_eq_slen(module, CONST_STR_LEN("mod_deflate"))) continue; } if (buffer_eq_slen(module, CONST_STR_LEN("mod_h2"))) { srv->srvconf.h2proto = 0; continue; } log_perror(srv->errh, __FILE__, __LINE__, "LoadLibrary() %s", tb->ptr); return -1; } buffer_copy_buffer(tb, module); buffer_append_string_len(tb, CONST_STR_LEN("_plugin_init")); init = (int(WINAPI *)(plugin *))(intptr_t)GetProcAddress(lib, tb->ptr); if (init == NULL) { log_perror(srv->errh, __FILE__, __LINE__, "GetProcAddress() %s", tb->ptr); FreeLibrary(lib); return -1; } #else #if defined(__CYGWIN__) buffer_append_string_len(tb, CONST_STR_LEN(".dll")); #else buffer_append_string_len(tb, CONST_STR_LEN(".so")); #endif if (NULL == (lib = dlopen(tb->ptr, RTLD_NOW|RTLD_GLOBAL))) { if (srv->srvconf.compat_module_load) { if (buffer_eq_slen(module, CONST_STR_LEN("mod_deflate"))) continue; } if (buffer_eq_slen(module, CONST_STR_LEN("mod_h2"))) { srv->srvconf.h2proto = 0; continue; } log_error(srv->errh, __FILE__, __LINE__, "dlopen() failed for: %s %s", tb->ptr, dlerror()); return -1; } buffer_clear(tb); buffer_append_str2(tb, BUF_PTR_LEN(module), CONST_STR_LEN("_plugin_init")); init = (int (*)(plugin *))(intptr_t)dlsym(lib, tb->ptr); if (NULL == init) { const char *error = dlerror(); if (error != NULL) { log_error(srv->errh, __FILE__, __LINE__, "dlsym: %s", error); } else { log_error(srv->errh, __FILE__, __LINE__, "dlsym symbol not found: %s", tb->ptr); } dlclose(lib); return -1; } #endif } plugin *p = plugin_init(); p->lib = lib; if ((*init)(p)) { log_error(srv->errh, __FILE__, __LINE__, "%s plugin init failed", module->ptr); plugin_free(p); return -1; } ((plugin **)srv->plugins.ptr)[srv->plugins.used++] = p; } return 0; }
最新发布
09-13
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值