I was recently installing plugins into one of my non-primary blogs on another host and saw this message.
What the heck?
How is it possible that my version of php could be “THAT OLD”?
Well, after checking in the cpanel for the host as well as checking on my directories on my server.
The version was actually much newer than the version being reported.
Several plugins were reporting this issue. Actually a few plugins were broken it seemed due to this older version of php.
This was bad. One of the plugins I wanted to install on this installation of wordpress was actually BREAKING my wordpress installation. I had to go into WordPress and remove the plugin manually since it would take down access to even the backend of WordPress.
That’s really terribly bad…
So what was the problem?
How to check on your Server
- SSH into your server
- type php –version
Is the version what you expect or is it the one reported via the wordpress plugin?
So if the version is correct, what else could it be.
In my case, it was the .htaccess file in the WordPress directory.
So here’s the issue.
It seems that the normal .htaccess in my root directory was correct.
BUT there are other .htaccess file created by WordPress (or other services) that are forcing it to use a earlier version of the file.
How to Fix the php .htaccess problem
You can do various things.
1. Delete the wordpress .htaccess (rm .htaccess)
This would cause you to use the .htaccess from a higher directory. However this is probably a bad idea especially if you have plugins that are editing this .htaccess or other wordpress specific aspects of it.
2. You can add in the line for the correct .php
You can get this line from the root directory .htaccess (if its using the version you want to use).
Just copy the line with AddHandler application/<php version> from that file into your wordpress .htaccess file. Be sure it matches exactly though
3. You can also comment out the line for the offending php version.
To do this, edit the file and add a # in front of the line you no longer want the system to use.
However when doing this be sure that there is no other offending .htaccess in a higher directory that may still cause it to report the wrong version or a conflicting version.
* * * * *
Did it Work?
For me that was it.
After editing the .htaccess file in WordPress my installation, plugins, and all the bad reporting disappeared suddenly. I finally was able to get back to work on getting this installation and version of WordPress. Honestly I need to log into WordPress more often to make sure things are up to date.
Actually the wordpress blog was faster now after fixing the problem as it was finally using the newer / better version of .php and all that goes with that.
So lesson here? Pay attention to the error messages and make sure that you regularly check to make sure your system is as up to date as possible. Even sites you may not check on a regular basis.