This problem is caused by an empty line before or after the PHP script, you need to search all your files and then discover the empty space and remove it
If you want to search and print a list of all PHP files that begin with an arbitrary empty line, SSH into your site and run this in your terminal:
find . -name "*.php" -type f -size +0 -exec gawk 'STARTFILE{if ($0 == "") print FILENAME}' {} +
If you want to search and print a list of all PHP files that end with an arbitrary empty line, SSH into your site and run this in your terminal:
find . -name "*.php" -type f -size +0 -exec gawk 'FNR==1{if ($0 == "") print FILENAME}' {} +
Leave a Reply