linux下安装nginx遇到的问题
1、下载nginx并上传到linux服务器usr/local/下
2、tar -zxvf nginx-1.9.9.tar.gz
3、cd nginx-1.9.9
4、./configure --prefix=/usr/local/nginx
5、遇到了这个困扰我很久的问题src/core/ngx_murmurhash.c: In function ‘ngx_murmur_hash2’:
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:
^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:445: objs/src/core/ngx_murmurhash.o] Error 1
make[1]: Leaving directory '/usr/local/nginx-1.9.9'
解决办法:
cd objs
vim Maefile
在第三行的这里 i 删掉框里的内容
esc :wq
6、cd ../ 到nginx-1.9.9目录下 make
又出现了一个新的问题
cd src/os/unix
vim ngx_usr.c
注释掉框里的内容
注意:用/* */注释 不要用#
7、回到nginx-1.9.9 make
make install即可