Я устанавливаю новое приложение в php, которое использует буферизацию вывода, код отлично работает на локальном сервере (wamp), но когда я загружаю свой код на рабочий сервер, код не работает,
<?php
ob_end_clean();
header("Connection: close");
ignore_user_abort(true); // just to be safe
ob_start();
echo('Text the user will see ');
$size = ob_get_length();
header("Content-Length: $size");
ob_end_flush(); // Strange behaviour, will not work
flush(); // Unless both are called !
// Do processing here
sleep(6);
echo('Text user will never see');
?>
Я ожидаю вывод 'Text the user will see'
, но сервер не закрывает соединение, но фактический вывод 'Text the user will see Text user will never see'