nginx showing blank PHP pages

前端 未结 17 2235
走了就别回头了
走了就别回头了 2020-12-04 05:56

I have setup an nginx server with php5-fpm. When I try to load the site I get a blank page with no errors. Html pages are served fine but not php. I tried turning on disp

17条回答
  •  臣服心动
    2020-12-04 06:17

    I had a similar problem, nginx was processing a page halfway then stopping. None of the solutions suggested here were working for me. I fixed it by changing nginx fastcgi buffering:

    fastcgi_max_temp_file_size 0;
    
    fastcgi_buffer_size 4K;
    fastcgi_buffers 64 4k;
    

    After the changes my location block looked like:

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_max_temp_file_size 0;
        fastcgi_buffer_size 4K;
        fastcgi_buffers 64 4k;
        include fastcgi_params;
    }
    

    For details see https://www.namhuy.net/3120/fix-nginx-upstream-response-buffered-temporary-file-error.html

提交回复
热议问题