• 1
  • 2
  • 3
  • 4
  • 5
阿里云主机ECS 首 页  »  帮助中心  »  云服务器  »  阿里云主机ECS
ECS Linux系统服务器php报500错误的原因及解决
发布日期:2015-12-23 16:12:12

  问题现象:Linux系统服务器php网站环境,网站访问报500错误,通过nginx日志有以下报错信息:

  recv() failed (104: Connection reset by peer) while reading response header from upstream;

  问题原因:php-fpm的request_terminate_timeout参数直接杀掉php进程导致

  解决方法:

  vi /etc/php-fpm.d/www.conf

  修改为:

  ; The timeout for serving a single request after which the worker process will

  ; be killed. This option should be used when the ‘max_execution_time’ ini option

  ; does not stop script execution for some reason. A value of ’0′ means ‘off’.

  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)

  ; Default Value: 0

  request_terminate_timeout = 0

  重启 php-fpm 和 Nginx 服务恢复正常。