random 502 gateway errors with nginx php-fpm and ubuntu

前端 未结 4 1153
长情又很酷
长情又很酷 2021-02-01 23:54

I was having an issue with random 502 gateway errors using nginx and php-fpm. In my case I discovered a scenario where various php.ini error_log settings and error_reporting lev

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 00:53

    I've run into this on windows machines running iis and php in fastCGI mode so it isn't just a nix problem.

    The culprit was php logging as well. You don't have to set it to a static directory though if you grant proper permissions it can write to the same directory that the script resides in. (Can be very helpful if you have a large and complicated site)

    My server is setup this way and I just added a rule to not serve the error logs to the public.

    To sum it up, CHECK PERMISSIONS! =)

提交回复
热议问题