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.