How to test PHP updates on WordPress
WordPress is written with the PHP coding language, which requires updates to the latest version in order to remain secure and running its best. But before getting on the latest version, it’s important to test PHP updates to ensure it works with the other components of your WordPress website.
Being as PHP is open source, that means that anyone can have access to it and search for vulnerabilities within. These vulnerabilities can then be used to exploit a site. But don’t be too alarmed by this fact. Developers are always improving its security and integrity.
Hence there are new versions being pushed out all the time.
That being said, though, it behooves you to use the most recent version of PHP to add to your website’s security. Using an outdated version can lead to disastrous consequences.
What is PHP?
PHP stands for PHP: Hypertext Preprocessor; if you were wondering. There have been numerous iterations of it along the way. PHP started sometime back 1994 by Rasmus Lerdorf. Since then, it has come a long way and each updated version improves on the last.
The very first iteration of PHP was merely a simple set of Common Gateway Interface (CGI) binaries written in the C programming language. Now it is considered the 10th most popular web programming language and is among the most commonly used to build websites today. PHP is an open-source scripting language that can be embedded into HTML (Hypertext Markup Language) pages.
What might happen if you don’t test PHP updates?
The most common issue with changing to an updated version of PHP is that your site will begin throwing deprecation errors, like in the example below:
If you see these errors, then your coding is not up to snuff and you’ll need to roll your sleeves up and update it. However, if you are running the most recent version of WordPress, you can, for the most part, run PHP 8.0 without issues. There are exceptions to that rule, though, like when you have out of date plugins on your site, or an out-of-date theme.
How to test PHP updates on WordPress
For this blog post, we’re using cPanel Web Hosting, although the process is similar for other platforms like Managed WordPress and Managed WordPress Ecommerce Hosting.
PHP Version Check
In a shared cPanel environment, you can view which version of PHP you are using by simply going to the Software section.
Select the icon Select PHP Version. The screen that loads up will display your current working version of PHP.
From here, you can toggle between PHP versions by selecting the drop-down menu. Then select Set as Current. This will change your working version of PHP to the new one.
If your site breaks, just toggle it back to the previous version and look into updating your code.
Checking Plugin/PHP Compatibility
If you have a site that throws deprecation errors and you’re running the latest and greatest WordPress version, check your plugins for PHP compatibility. Go to your WordPress dashboard. Then select Plugins, from the left-hand side. From here, select View details for the plugin giving the errors.
This will open a dialog box with the plugin details. To the right, you’ll see what version of PHP that particular plugin is compatible with.
If the PHP version is not compatible with the latest PHP version, then you’ll want to find a replacement plugin, as if you keep hold of an outdated plugin, then you’re asking for troubles down the line. Likewise, if it is a theme PHP deprecation issue, you’ll definitely want to invest in a new theme.
It’s important to test PHP updates
All in all, your hard work needs to be cherished and protected. Besides all the usual security measures you can take to secure your site, PHP is definitely one you should consider looking into — running out-of-date anything can and typically will turn around and bite you in the tail.
Running the most recent version of PHP is a simple and effective way to help ensure your site is safe and looking groovy for the masses.