Be very careful editing PHP files

My application is a photo database, and one day recently the JPEGs stopped displaying.
After a lot of searching for permission related issues in both Dadabik and Linux, I finally discovered with the help of a friend that the JPEGs were being delivered from the server, but that a leading CRLF had been inserted INTO the JPEG data stream.
Googling then led to a related problem somebody had, and I found the reason.
It turned out than an edit of one of the PHP config files had added an extra trailing CRLF after the final > of the PHP, and this must have been buffered somewhere and was emitted when the JPEG file was fetched. In the rest of the application, a spurious CRLF in the HTML each time the PHP config file was included went unnoticed.
 
Top