title: Laravel, PHP 7.3 nginx 502 upstream prematurely closed FastCGI stdout
body: <p>I have a laravel application behind nginx and recently updated php from version 7.1 to 7.3 (docker image 7.1-fpm-alpine to 7.3-fpm-alpine).</p>
  
  <p>I use exceptions that have a <code>render()</code> function to output error pages. Laravel logs the exception message and complete stacktrace.</p>
  
  <p>Since updating to php 7.3, nginx shows it's default 502 error page and logs <code>[error] 11#11: *61 upstream prematurely closed FastCGI stdout while reading response header from upstream, client: [...]</code>. The stacktrace in nginx is truncated after 2048 bytes.</p>
  
  <p>The serverfault question <a href="https://serverfault.com/questions/256459/nginx-php-fpm-long-log-lines-get-truncated">"Nginx/PHP-FPM long log lines get truncated"</a> suggests that nginx handles only errors up to 2048 bytes.</p>
  
  <p>In PHP 7.1 the stacktrace was truncated already.</p>
  
  <p>Am I right, that the problem is that PHP now logs the complete stack trace instead of truncating it?</p>
  
  <p>Is there a way to truncate log output in PHP to return to the behaviour of PHP 7.1?</p>