WordPress White Screen Error

What causes this?

It may be a line ending problem. In *nix, the line ending is a single new line character. In windows it is a carriage return character followed by a new line character. Unicode encoded files can also affect line endings.

Check your text editor documentation. There should be a way to convert DOS documents to UNIX documents and not transfer all those carriage returns to your web server.

I have seen it happen on client web sites. A theme file will have every other line blank. I usually run it through a search and replace (in my text editor) to change 2 consecutive line feeds into one and upload the file again.

I read an article stating that a white screen error will appear if there are spaces before <?php and after ?>

You can avoid the trailing space problem by removing the final ?> from files you edit. I think this is recommended somewhere in the PHP Manual. If your editor is capable, you can use search and replace across files to remove spaces at the top of PHP files. Just back them up first. 🙂