Bug #75870 [Fbk->Opn]: header() terminates execution when Content-Length is 0

From: Date: Wed, 24 Jan 2018 21:30:48 +0000
Subject: Bug #75870 [Fbk->Opn]: header() terminates execution when Content-Length is 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213695@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75870&edit=1 ID: 75870 User updated by: km dot wrona at gmail dot com Reported by: km dot wrona at gmail dot com Summary: header() terminates execution when Content-Length is 0 -Status: Feedback +Status: Open Type: Bug Package: *General Issues Operating System: Alpine PHP Version: 7.1.13 Block user comment: N Private report: N New Comment: nginx 1.12.2 php-fpm 7.1.12 I've changed the test script in accordance with your advice to the following: ---- header('content-length: 0', false, null); touch('/var/www/html/'.time()); die('done'); ---- Neither the file was created nor the "done" was displayed. I've rebuilt my container to use php7.2.1 and it's exactly the same. Previous Comments: ------------------------------------------------------------------------ [2018-01-24 20:23:32] requinix@php.net What web server (Apache, nginx, etc.) and how is PHP running (like via module or FPM)? And are you sure *execution* stops or can you simply not see the output? Try something like touch()ing a file. ------------------------------------------------------------------------ [2018-01-24 18:03:30] km dot wrona at gmail dot com Description: ------------ header() terminates execution when content-length is 0 This happens on Alpine3.7 php 7.1.12, for some reason not available in the list above. It works fine on Ubuntu 16.04 php 7.1.13 Test script: --------------- <?php header('content-length: 0', false, null); echo 'this is longer than 0'; exit; Expected result: ---------------- this is longer than 0 Actual result: -------------- NOTHING (BLANK) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75870&edit=1

« previous php.bugs (#213695) next »