Does anyone know why some of my websites add a blank line after every line of code, while others on the same host and server leave the files untouched?

A few details that might help:

  • PHP Version 5.3.5
  • Linux Servers
  • MySQL- Client API version 5.1.56
  • SERVER["HTTP_ACCEPT_CHARSET"] (ISO-8859-1,utf-8;q=0.7,*;q=0.7)

NOTE: I can provide additional config info, I wasn't sure which details if any would be helpful.

I can download the file via FTP and the additional lines are present, but if I copy and paste from the WP Theme Edit page the additional lines aren't there.

This is more of an annoyance than a problem. I don't believe any problems are caused by the odd behavior, but I am curious to know if anyone else has noticed this and if anyone knows the cause. I'm not sure if this is a WordPress or simply a server config issue. Any input is appreciated.

Regards, JJ

1 Answer 1


I think the difference is probably something to do with the editor you use to edit files, and specifically the line ending characters.

DOS machines (like Windows) use a carriage return character and a line feed ("\r\n") as a line ending, and Unix-based machines (newer Macs and Linux included) use just a single line feed character ("\n"). When files are transferred back and forth between the two different systems and through different text editors, those line breaks get converted in different ways.

I wouldn't worry about it, unless it really seriously bugs you. Most text editors can be configured to recognize different EOL characters and account for them or convert them to your desired format. And if not, there's always find/replace.

  • Thanks for the clear and descriptive answer. That makes sense, I was focused on the server causing the issue and it never clicked that I'm using phpDesigner7 on a windows 8 machine. I recall seeing the option in the editor options to switch file formats. Would there be any issues if I were to select the Unix file format? It does bother me, but if it's more than just changing the options in the editor, or it causes other problems I can live with it. Once again I appreciate the help. Nov 10, 2011 at 22:20
  • Changing the file EOL format should be a harmless operation... you might find, however, that the line breaks have already been automatically converted. In the future, though, just pick one setting across all the editors you use and stick with it. Nov 10, 2011 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.