V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yangyifan
V2EX  ›  PHP

请教一个 nginx 502 的错误

  •  
  •   yangyifan · 2016-08-12 20:04:36 +08:00 · 1890 次点击
    这是一个创建于 2817 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题是我上传文件的时候,第一次可以上传成功,第二次就是 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 的配置文件就是和默认一样的!

    第 1 条附言  ·  2016-08-12 20:37:55 +08:00
    我用 ``` opcache_reset ``` 方法,在每次上传完成后,就调用该方法,但是还是想刨根问底,这个到底是怎么样才能产生的!
    2 条回复    2016-08-13 19:18:00 +08:00
    a2521298
        1
    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
        2
    yangyifan  
    OP
       2016-08-13 19:18:00 +08:00 via iPhone
    @a2521298 感谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   928 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 105ms · UTC 21:02 · PVG 05:02 · LAX 14:02 · JFK 17:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.