|NO.Z.00001|——————————|^^构建^^|——|Nginx&Nginx常见报错&解决方案|

【|NO.Z.00001|——————————|^^构建^^|——|Nginx&Nginx常见报错&解决方案|】五陵年少金市东,银鞍白马渡春风。这篇文章主要讲述|NO.Z.00001|——————————|^^构建^^|——|Nginx&Nginx常见报错&解决方案|相关的知识,希望能为你提供帮助。
报错处理一:

### --- 报错现象:[root@cdeba90ec46e ~]# ./configure --prefix=/usr/local/nginx--user=www--group=www--with-http_stub_status_module bash: ./configure: No such file or directory

### --- 报错分析: ~~~表示在执行预编译./configure没有找到configure执行文件,改文件不存在。

### --- 解决方案: ~~~检查执行命令时是否在该源代码的目录之下。

报错处理二:
### --- 报错现象:[root@cdeba90ec46e nginx-1.16.0]# ./configure --prefix=/usr/local/nginx--user=www--group=www--with-http_stub_status_module checking for C compiler ... not found ./configure :error:C compiler cc is not found

### --- 报错分析:表示在编译时Nginx软件服务时, ~~~需要提前检测linux操作系统是否存在GCC编译环境,错误显示c编译器没有找到, ~~~c编译器对应的CC工具不存在。[root@cdeba90ec46e nginx-1.16.0]# whereis cc// 检测cc是否存在 [root@cdeba90ec46e nginx-1.16.0]# which cc

### --- 解决方案:[root@cdeba90ec46e ~]#yum -y install gcc

报错处理三:
### --- 报错现象: ~~~通过MAKE源码方式编译Nginx WEB平台,执行预编译参数,[root@cdeba90ec46e ~]# ./configure --prefix=/usr/local/nginx--user=www--group=www--with-http_stub_status_module ./configure:error:the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module

### --- 报错分析: ~~~根据如上错误提示,表示安装Nginx软件服务时, ~~~需要开启Rewrite模块功能(浏览器访问URL地址可以实现重定向,跳转) ~~~而rewrite模块功能需要查找和依赖linux操作系统PCRE LIB库(Perl语言的正则库) ~~~而PCRE LIB库没有找到,所以报错。 ~~~重定向: 从一个网址跳到另外一个网址,通过rewrite功能实现。 ~~~查找有没有PCRE库。find不到万不得已不要用,用的话会做背锅侠, ~~~跟rm -rf类似,会消耗系统的性能。[root@cdeba90ec46e nginx-1.16.0]# find / -name "*pcre*.so"

### --- 报错分析: ~~~通过yum安装PCRE库: ~~~pcre是主程序,pcre-devel是开发库。[root@cdeba90ec46e nginx-1.16.0]# yum -y install pcre pcre-devel

报错处理四:
### --- 报错现象: ~~~通过MAKE源码方式编译Nginx WEB平台,执行预编译参数,[root@cdeba90ec46e ~]# ./configure --prefix=/usr/local/nginx--user=www--group=www--with-http_stub_status_module You can either disable the module by using --without-http_gzip_module

### --- 报错现象: ~~~根据如上错误提示,表示安装nginx web软件服务时,需要开启GZIP模块功能, ~~~(用于nginx开启压缩功能,对应静态网页,文件压缩) ~~~需要依赖linux操作系统Zlib库,而Linux操作系统Zlib库没有找到,所以报错。

### --- 解决方案: ~~~通过手动方式安装zlib库文件, [root@cdeba90ec46e ~]# yum -y install zlib zlib-devel

报错处理五:
### --- 报错现象:[root@cdeba90ec46e ~]# /usr/local/nginx/sbin/nginx nginx: [emerg] getpwnam("www") failed

### --- 报错分析:~~~没有创建用户

### --- 解决方案: ~~~创建用户和用户组[root@localhost ~]# groupaddwww [root@localhost ~]# useradd-gwww www [root@localhost ~]# usermod-s/sbin/nologinwww

报错处理六:
### --- 报错现象:~~~若web网页无法访问我们的网页;

### --- 报错分析:~~~本地ping一下我们的主机是否允许 ~~~查看进程:ps -ef |grep-aw nginx ~~~查看端口是否开启:netstat -tunlp |grep 80 ~~~端口服务都没有问题;查看服务器防火墙80 端口是否开启

### --- 解决方案: ~~~查看防火墙规则:[root@localhost ~]# firewall-cmd --list-all --zone=public FirewallD is not running

报错处理七:
### --- 报错现象: ~~~nginx从1.16.降级为1.10.3版本预编译报错:[root@cdeba90ec46e nginx-1.10.3]# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module 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:460: objs/src/core/ngx_murmurhash.o] Error 1 make[1]: Leaving directory /root/nginx-1.10.3 make: *** [Makefile:8: build] Error 2

### --- 报错分析:~~~https://www.jiweichengzhu.com/article/cc4ed4eeb4644586b81e9070a96c0bda

### --- 解决方案: ~~~待补充

报错处理八:
### --- 报错现象:[root@27ba4cba71d5 ~]# yum -y install mariadb-server mariadb mariadb-devel Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:08:24 ago on Tue Nov3 07:48:24 2020. Error: Problem: problem with installed package mysql-devel-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 - package mysql-devel-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 conflicts with mariadb-devel provided by mariadb-devel-3:10.3.17-1.module_el8.1.0+257+48736ea6.x86_64 - package mariadb-devel-3:10.3.17-1.module_el8.1.0+257+48736ea6.x86_64 conflicts with mysql-devel provided by mysql-devel-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 - conflicting requests (try to add --allowerasing to command line to replace conflicting packages or --skip-broken to skip uninstallable packages or --nobest to use not only best candidate packages)

### --- 报错分析:~~~提供的软件包与linux默认程序的软件包冲突:加入选项: --allowerasing替换掉就OK

### --- 解决方案:[root@27ba4cba71d5 ~]# yum -y install mariadb-server mariadb mariadb-devel --allowerasing

报错处理九:
### --- 报错现象:[root@27ba4cba71d5 ~]# yum -y install php php-devel php-fpm php-mysqlnd Last metadata expiration check: 0:19:44 ago on Tue Nov3 07:48:24 2020. No match for argument: php-mysql Error: Unable to find a match: php-mysql

### --- 报错分析:~~~可能是名字错误:php-mysql 改为php-mysqlnd即可

### --- 解决方案:[root@27ba4cba71d5 ~]# yum -y install php php-devel php-fpm php-mysqlndphp-devel

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warmd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor

    推荐阅读