WP-ADMIN giving a blank white screen
I look after a few blogs, and one of them started giving some trouble that had me baffled.
Every time I logged into the Admin section, all I got was a white screen.
Seeing as I had no access to Admin, it was very difficult to diagnose what was wrong.
The first thing I did was to check my .htaccess files, and also did a check to see if there were any files there that had been inserted. All was fine, so I was fairly sure my site hadn’t been hacked.
The second thing I did was to upload a new version of WordPress. This hopefully would overwrite any files that had been modified. Still no joy.
Just in case there were any additional files that had been inserted, I then deleted my WordPress files [with the exception of wp-config file and wp-content directory] and reinstalled. I was reluctant to do this, as it’s a live site that gets quite a bit of traffic. It didn’t clear the problem anyway.
I trawled the Internet, and the main suggestion seemed to be that a plugin may be at fault. I renamed the plugin directory, and tried again. Still no joy.
I eventually found the solution to my little problem, and I must say I was surprised, and more than a little annoyed, as it’s a WordPress bug that should be addressed.
The following are a Before and After snapshot of my wp-config file.
Before
After
Notice the difference?
Note the line numbers.
Apparently the addition of white-space at the end of the file was sufficient to muck up the system. Why, I don’t know but deleting the three blank lines was enough, and the site is now working perfectly.
Very strange.
the reason would be to do with how web-pages work.
the server sends its headers, followed by an empty line (two “\n”s), followed by the HTML.
in your problem case, the config file was loaded by WP, which then went on to show its headers and then its HTML. Problem was, the config file had already rendered some line-spaces to the browser, meaning that header calls failed.
the solution is to either do as you did and make sure there are no line-spaces at the end, or to follow good programming style (the WP team should be doing this one…) and don’t put an end “?>” in any PHP files.
That is a very old config file, and of course it is one of the very few files that is never upgraded. I would have imagined there would be some way of stripping off unwanted lines by now?
I suppose they just assume that those lines will never creep in, though there should be warnings as it is a file that is commonly edited.
I moved my blog to my dedicated server yesterday. Simply a backup and restore job and now I have the same problem.
I did find a blank line at the end of my config but removing it didn’t help.
The strange thing is that it was working perfectly on the old server which is absolutely 100% identical to the current one. Software, updates etc. The only thing that’s different is the IP address!
There must be a difference then in the server configuration? Have you tried doing a comparison of phpinfo() off each server?
Oddly I got it sorted by uploading wordpress manually and overwriting what was already there. Same version too.
The only difference was the borked install was upgraded via the automatic upgrade option from the Admin page.
Very strange. Somehow one of the original installed files must have been corrupted, but that seems unlikely? Just put it down to a “we will never know the answer” problem.
It’s a funny problem alright, wordpress is far to edittable to be suffering from a config problem like this! Tom