Nginx – PHP header redirect working in nginx even output sent

nginxPHPphp-fpmphp5

note: There is a similar question but that's about Apache.

The following code

<?php
echo '.';
header('Location: http://stackoverflow.com');

is fully 'working' under nginx 0.7.67 where 'working' means the php redirect is working fine without errors in the error log or displaying the ..

How can i force nginx or php-fpm to throw the PHP Warning: Cannot modify header information - headers already sent by warning?

Best Answer

You should check value of output_buffering parameter in your php.ini file.

php.ini #output-buffering

Related Topic