A while back I had problems with my site. Periodically, I received an email from my hosting provider that there were problems with my server. Among other things, there was not enough RAM memory available which made my site unavailable and I had to continuously look at an HTTP 500 error message. Having worked with WordPress for years, compatibility issues with plugins are no stranger to me. So at first I went to check these, including my own files of both my theme and the widgets I had created myself. Nowhere was there an error to be found so I suspected it was down to my server.
I still had a fairly old package – namely, the very first package I had purchased in 2009. Since then some changes have been made at my hosting provider to the various packages so I had upgraded my current one. The higher the package, the more memory is available, and that was precisely the problem on my server. Unfortunately, this was also to no avail and in retrospect I regret spending money on this upgrade now.
After an email with the help desk explaining my problems, they came up with several possibilities what it could be due to. I dove into the settings and found out that my server was using an outdated version of PHP, namely version 5.3! I was not familiar with the fact that I had to manually adjust these myself, but no sooner said than done, and all problems were fixed with that. Version 5.3 dates from 2013, so not very surprising that there were problems.
Using an outdated version of PHP unnecessarily uses up resources and is thus disastrous for your server. Resource utilization is an umbrella term for storage space, data traffic (bandwidth), CPU (processor) and memory, among others.
Then when I received several emails from customers with the same problems at the same hosting provider, where the solution was to change the PHP version, I decided to write a little blog about it.
What is PHP?
By now you’ve heard a lot of terms that probably give you the creeps, yet I always think it’s more important to break them down so you know roughly what it’s about, without blindly copying everything (sweet that you trust me, but some background information is always helpful).
WordPress, or any other CMS, needs PHP to run on a Web server. PHP is a scripting language that allows a Web site to be dynamic. Just in Jip and Janneke language – in order to post this message I need PHP so that it can then be read on my site. Of course, I do not do this myself and certainly not manually! For that, again, I use the CMS program WordPress. Among other things, WordPress needs PHP to process tasks, including, therefore, posting this post.
The nice thing about a scripting language like PHP is that it is constantly innovating. It expands the capabilities but also simplifies the way you can have some functions performed. Where we used to need pieces of text to get a task done, now you get it done in a few lines. Same story with CSS, this is one of the reasons I now prefer SCSS/SASS. Sometimes functions are also removed (aka deprecated in English) which can cause conflicts, as the function can no longer be fully understood.
Technology is changing rapidly and so are the (scripting) languages needed to do so to keep technology running.
WordPress recently had an update, but did you know that there is now also a new version of PHP? Previously (in general) we were still working with version 5.5, there is now PHP 7. So that means we need to start updating and you with your WordPress site, probably too!
WordPress uses at least version 5.6, however, I see that most are still using version 5.3 (including me). So it’s logical that problems can arise with your server because everything is outdated.
Are you also suffering from excessive RAM usage or other server problems? So chances are the PHP needs to be updated. How? You do it like this.
Do the WordPress Health Check
- Install the My WordPress Health Check plugin
- Activate the plugin and run it (under Extra – Health Check) This plugin checks the health of your WordPress installation for the following points: server, WordPress and plugins. My WordPress Health Check indicates which PHP version your server is running, that is, the version used for your CMS including WordPress. Also, this plugin indicates which MySQL version is being used, however, this often cannot be changed manually. It also checks that all plugins are up-to-date.
- Are you still using PHP version of 5.5 or lower? Then it is certainly advisable to adjust it. PHP 5.5 has not received security updates since July this year. So it is very important to keep your PHP version up-to-date, in addition to WordPress, plugins and themes. WordPress runs fully on the latest and therefore newest PHP version 7, however, there is a small chance that if you change your PHP version, it may cause problems.
How should I change my PHP version?
It takes some work but it is better to prepare the switch properly so that if something goes wrong, you can always get your site back. Many web hosting providers allow you to choose which PHP version to use. You’ll have to take a moment to see if this story applies to your website. If you purchase hosting from Antagonist, then this story totally relates to you because chances are you are still using version 5.3!
- First, it is important that all plugins, installed themes and WordPress itself are up to date. Really everything should be the latest version so you can’t have a conflict with another PHP version. After all updates, check that your site is still working properly. Always smart of course 😉 If you know in advance that a plugin will conflict with your site then it is advisable not to use it anyway and look for a replacement. A conflict, such as an error message, simply does not belong and is a sign that something on your site is wrong.
- Is everything up to date? Next, back up your entire site, including your database. You can do this easily with the Updraft Plus plugin. Backing up regularly is always smart.
- You purchased your domain + hosting somewhere, in doing so you received a login to your web hosting server, DirectAdmin or something similar. It has a different name at many providers. It is your domain’s server where you can change all the settings. Login to this web hosting server.
- Scroll to Advanced Features – Select PHP version.
- There it says which version you are currently using and in the dropdown field, you can select another version. Is the transition big to go from 5.3 to 7? Then choose the safe option and select version 5.6. If you are already working with version 5.6 then you can switch to 7 right away. Click Set as Current to save the change.
- No need to look at the checkbox options, changing the PHP version is sufficient.
- Wait about 10 minutes for the server to process the change. Check the website.
- Is everything working properly? Then you can modify it to use version 7.
PHP version 7 gives an error message
If you change the PHP version to 7 and the website does not work, there is a good chance that there is a conflict with a plugin. It regularly happens that a plugin becomes obsolete and is not updated by its creator. The scripting language has been changed so a certain function/task that are in the plugin can no longer do its job properly. You can then do the following:
- Deactivate all plugins. Go to Plugins, check the box next to All plugins and then click deactivate in the dropdown field.
- Test website. Is it working properly again? So then you are 100% sure that it is due to a plugin.
- Go back to plugins, activate one plugin and then test the website. You do this for each plugin. It takes some work but this will help you figure out which plugin is causing the conflict.
- Have you found the plugin that is causing problems? Then deactivate and remove it and look for a replacement.
- Are you still having problems? Then leave all plugins set to deactivate and try changing the theme to a standard WordPress theme (such as the official Twenty themes). In fact, these too may be outdated.
- If this also fails, contact your hosting provider. In fact, WordPress works best on PHP version 7 (at least 5.6). A look by someone with more technical experience is then required.
- By the way, using version 5.6 is not bad, but if possible, it is always advisable to use the latest version.
Once you have successfully made the change to version 7 (or 5.6), wait a few days to see if any change can be seen. If you purchase hosting from Antagonist you can log in under My Antagonist – My Product and on the right side you will see a Resource Usage button. There you can assess whether there are still problems on the server.
I hope this article has helped you solve any problems with your server. In case you are with a hosting provider other than Antagonist and need help adjusting the PHP version, you may always contact us.