请教一个 nginx 502 的错误

2016-08-12 20:04:36 +08:00
 yangyifan

问题是我上传文件的时候,第一次可以上传成功,第二次就是 502 错误!而且没有任何错误信息,但是我重启 php-fpm 就又可以上传了!

还有我开启了 opcache ,但是我关闭了就可以了,也不需要重启 php-fpm !

错误信息: nginx :没有错误信息

php-fpm :有 WARNING 信息


```
[12-Aug-2016 19:48:04] WARNING: [pool www] child 974 exited on signal 11 (SIGSEGV) after 334.939708 seconds from start

[12-Aug-2016 19:48:04] NOTICE: [pool www] child 1014 started ```

php-fpm ``` [root@iZ9432kvp6sZ log]# netstat -napo |grep "php-fpm" | wc -l 4

```

nginx 配置文件 (没有粘贴出来 server 端的)



worker_processes  auto;
worker_rlimit_nofile 100000;
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  2048;
    multi_accept on;
    use epoll;
}


http {
    include       mime.types;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;
    client_max_body_size 300M;#设置 post 数据大小


    #gzip  on;
    access_log  off;
    error_log /var/log/nginx/error.log; #crit;
    server_tokens off;
    sendfile        on;
    #tcp_nopush     on;
    #tcp_nodelay on;
    #keepalive_timeout 65;
    #client_header_timeout 10;
    #client_body_timeout 10;
    #reset_timedout_connection on;
    #send_timeout 10;
    #limit_conn_zone $binary_remote_addr zone=addr:5m;
    #limit_conn addr 100;
    default_type text/html;
    charset UTF-8;

    #gzip  on;
    #gzip_proxied any;
    #gzip_min_length 1000;
    #gzip_comp_level 4;
    #gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;


    #open_file_cache max=100000 inactive=20s;
    #open_file_cache_valid 30s;
    #open_file_cache_min_uses 2;
    #open_file_cache_errors on;

    keepalive_timeout  65;
        fastcgi_connect_timeout 300;
		fastcgi_send_timeout 300;
		fastcgi_read_timeout 300;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 8 128k;#8 128
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
        

php 的配置文件就是和默认一样的!

1904 次点击
所在节点    PHP
2 条回复
a2521298
2016-08-13 02:00:03 +08:00
巧了,我前几天刚遇到,是程序问题,不关 nginx 和 FPM 的事,你可以参考

http://blog.druggo.org/post/2013/05/02/%E4%B8%80%E4%BE%8Bphp%E8%BF%9B%E7%A8%8B%E7%9A%84SIGBUS%E6%95%85%E9%9A%9C
yangyifan
2016-08-13 19:18:00 +08:00
@a2521298 感谢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/298960

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX