Over the past few weeks, I’ve had a few clients contact me saying that their website won’t load. Instead, their current installation of WordPress tries to download a file whenever they access their site.

This doesn’t matter if you try to access wp-login.php, /wp-admin, or any of the usual directories. Further, if you look at the permissions on each of the files, everything looks in order.

WordPress File Permission Scheme

On top of that, there are no suspicious (read: malicious) files in place that would be redirecting a user’s request or anything like that.

So what gives?

WordPress Tries to Download a File

The problem could be any number of factors, but what I’ve to be one of the most common problems is that the host has ended up changing something about Apache as well as the version of PHP running the server and has either opted not to notify the user or the information has not been passed on to me.

Whatever the case, this is how I’ve been resolving this issue. But first, note that…

  • Many of the installations that I’ve been working with are using older versions of WordPress,
  • The hosts on which the sites are running are not necessarily “top-tier” hosts.

With that said, let’s say the the default .htaccess file looks like this:

Nothing out of the ordinary. But if the server has made changes to the web server and has, say, enabled the PHP5 module, then you may need to add a directive to the file instructing the server to use a handler for PHP5:

Save the file, upload it, and you should (read: may) be good to go. I don’t know if this will solve your particular problem, but I’ve seen this happen a few times now and this seems to be the fix especially when working with older (that is, pre-4.0) versions of WordPress.

For those who are curious, the reason this works is that you’re instructing the web server to use a PHP5 handler to handle requests for PHP files. If, for some reason, the host has been upgraded and not configured correctly, this is one way to provide a manual fix.