|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-01-24 18:03 UTC] 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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
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.Modified the script again to be: ---- touch('/tmp/1'); header('content-length:0',false, null); touch('/tmp/2'); die('done'); ---- Both 1 and 2 exist, no "done" is displayed, so it looks like it does not terminate...