Yesterday I migrated our MySQL data from one RDS to another, the only difference being that the one I migrated to has AWS's new-ish encryption feature enabled.
All is well and good EXCEPT that since the migration we have a persistent '\n' in our output buffer. To make things stranger this is true in both our "legacy" code as well as our Laravel code which don't share the same include files / templates.
This has disrupted a lot of our functionality and we have had to go with a bandage approach of clearing out the buffer before echoing out values or sending range requests to the server for things like video streaming.
The ONLY changes that took places on our application servers (where PHP/Apache live) was the connection string to the RDS. Everything else remained the same, we didn't even change any code.
All that said, has anybody else run into this? We do not have an 'auto_prepend_file' and our application has been running in this environment problem free for over a year. The only change was literally pointing at a different database which happens to be encrypted at rest.
Any insight would be appreciated.
Turns out it was my fault! Our global config file (which does include a closing PHP tag) had a new line introduced yesterday after the ending tag. This file is included globally which is why we saw the issue everywhere.
.... your code
?>
(new line here resulting in the end of the world)
Problem solved, all could have been avoided by not using an ending PHP tag. Hopefully this helps somebody else down the line!