• 欢迎光临~

centos-stream中安装nginx遇到的问题一二

开发技术 开发技术 2022-12-20 次浏览

在centos-stream中安装nginx-1.9.15时

遇到在make时遇到如下问题:

在nginx文件夹里执行make命令报错

src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[2] << 16;
         ~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
     case 2:
     ^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[1] << 8;
         ~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
     case 1:
     ^~~~ 

解决
修改Makefile文件,将Werror字样去掉

[root@localhost fastdfs]# vim ./nginx-1.8.0/objs/Makefile

CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g 


修改ngx_user.c文件,将cd.current_salt[0] = ~salt[0]注释掉

/* work around the glibc bug */
/* cd.current_salt[0] = ~salt[0]; */

程序员灯塔
转载请注明原文链接:centos-stream中安装nginx遇到的问题一二
喜欢 (0)