nginx错误汇总

1.pcre问题

 In file included fromsrc/core/ngx_core.h:72:0,

                 from src/core/nginx.c:9:

src/core/ngx_regex.h:15:18: fatal error:pcre.h: No such file or directory

 #include <pcre.h>

 

 解决方案:

yum installpcre-devel 这个是重写模块必须的

非常感谢各位的回答,当时只安装了pcre库,没安装pcre-devel 问题解决了,谢谢各位

 

2.openssl版本错误

home/webrtc/live/zlib/ -I objs \

       -oobjs/src/event/ngx_event_openssl.o \

       src/event/ngx_event_openssl.c

src/event/ngx_event_openssl.c: In function‘ngx_ssl_dhparam’:

src/event/ngx_event_openssl.c:954:11:error: dereferencing pointer to incomplete type

        dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);

          ^

src/event/ngx_event_openssl.c:955:11:error: dereferencing pointer to incomplete type

        dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);

          ^

src/event/ngx_event_openssl.c:957:15:error: dereferencing pointer to incomplete type

        if (dh->p == NULL || dh->g == NULL) {

               ^

src/event/ngx_event_openssl.c:957:32:error: dereferencing pointer to incomplete type

        if (dh->p == NULL || dh->g == NULL) {

                                ^

src/event/ngx_event_openssl.c: In function‘ngx_ssl_connection_error’:

src/event/ngx_event_openssl.c:1941:21:error: ‘SSL_R_NO_CIPHERS_PASSED’ undeclared (first use in this function)

            || n == SSL_R_NO_CIPHERS_PASSED                          /*  182 */

                     ^

src/event/ngx_event_openssl.c:1941:21:note: each undeclared identifier is reported only once for each function itappears in

make[1]: ***[objs/src/event/ngx_event_openssl.o] Error 1

make[1]: Leaving directory`/usr/local/nginx'

make: *** [build] Error 2

 

 

解决方案

The OpenSSL API has changed quite a bit in 1.1.0... thismeans that nginx needs some work to adapt. I recommend you talk with the nginxfolks.

 

替换openssl的包为1.0.1的版本

 

 

3.pcre版本错误

cd /home/webrtc/live/pcre \

&& make libpcre.la

make[2]: Entering directory`/home/webrtc/live/pcre'

make[2]: *** No rule to make target `libpcre.la'.  Stop.

make[2]: Leaving directory`/home/webrtc/live/pcre'

make[1]: ***[/home/webrtc/live/pcre/.libs/libpcre.a] Error 2

make[1]: Leaving directory`/usr/local/nginx'

make: *** [build] Error 2

 

解决方案:

pcre2-10.20.tar.gz

切换到pcre-8.39.tar.bz2版本

 

 

 

 

4.make install错误

[root@localhost nginx]# make install

make -f objs/Makefile install

make[1]: Entering directory`/usr/local/nginx'

test -d '/usr/local/nginx' || mkdir -p'/usr/local/nginx'

test -d '/usr/local/nginx/sbin' \

       ||mkdir -p '/usr/local/nginx/sbin'

test ! -f '/usr/local/nginx/sbin/nginx' \

       ||mv '/usr/local/nginx/sbin/nginx' \

              '/usr/local/nginx/sbin/nginx.old'

cp objs/nginx '/usr/local/nginx/sbin/nginx'

test -d '/usr/local/nginx/conf' \

       ||mkdir -p '/usr/local/nginx/conf'

cp conf/koi-win '/usr/local/nginx/conf'

cp: ‘conf/koi-win’ and‘/usr/local/nginx/conf/koi-win’ are the same file

make[1]: *** [install] Error 1

make[1]: Leaving directory`/usr/local/nginx'

make: *** [install] Error 2

[root@localhost nginx]# mv /usr/local/nginx

mv: missing destination file operand after‘/usr/local/nginx’

Try 'mv --help' for more information.

 

 

解决方案:

nginx源码包目录和安装目录(配置的),产生了冲突

 

把nginx源码包从/usr/local/nginx  拷贝到/home/username/nginx

重新makeinstall

 

5.nginx reload出错

 

[root@localhost sbin]# ./nginx -s reload

nginx: [error] open()"/usr/local/nginx/logs/nginx.pid" failed (2: No such file ordirectory)

 

 

解决方案

[root@localhostsbin]# ./nginx -c /usr/local/nginx/conf/nginx.conf

//查看文件是否存在

[root@localhostsbin]# ls /usr/local/nginx/logs/

access.log  error.log nginx.pid

 

使用nginx -c的参数指定nginx.conf文件的位置

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Nginx FastCGI错误是指在使用Nginx作为Web服务器并与FastCGI进程通信时出现的错误。以下是一些常见的Nginx FastCGI错误及其解决方法: 1. "upstream prematurely closed FastCGI input" 错误表示FastCGI进程提前关闭了连接。可能的原因是FastCGI进程超时或崩溃。解决方法包括增加FastCGI进程的超时时间或重新启动FastCGI进程。 2. "connection refused while connecting to upstream" 错误表示Nginx无法连接到FastCGI进程。可能的原因是FastCGI进程未启动或FastCGI进程的监听端口被占用。解决方法包括确保FastCGI进程已经正确启动并监听正确的端口。 3. "recv() failed" 错误表示Nginx无法接收来自FastCGI进程的响应。可能的原因是连接超时、网络故障或FastCGI进程崩溃。解决方法包括增加连接超时时间、检查网络连接并重新启动FastCGI进程。 4. "upstream sent unsupported FastCGI protocol version" 错误表示Nginx和FastCGI进程之间的协议版本不兼容。可能的原因是FastCGI进程使用了不支持的协议版本。解决方法包括更新FastCGI进程以使用与Nginx兼容的协议版本或升级Nginx以支持该协议版本。 5. "upstream sent too big header while reading response header from upstream" 错误表示FastCGI进程返回的响应头部过大。可能的原因是FastCGI进程返回了非常大的响应头部。解决方法包括增加Nginx配置中的"fastcgi_buffer_size"和"fastcgi_buffers"参数大小,以容纳更大的响应头部。 通过了解这些常见的Nginx FastCGI错误,我们可以更好地理解问题的根本原因,并采取适当的措施来解决这些问题,从而提高Web服务器的可靠性和稳定性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值