How To Check And Update PHP Version in WordPress?
Did you know that WordPress is built on PHP? You might have noticed .php files in your file directory. PHP is the programming language that is used to build the core WordPress functionalities and you can make changes to the WordPress site by editing PHP codes.
Like any other software or programming language, PHP needs to update in order to fix bugs, add features and upgrade security.
Developers work on and make these updates available for you to keep up with the technology that powers your WordPress site.
Table of Contents
- Why update PHP version in WordPress?
- PHP in WordPress Website
- How to check your WordPress PHP version?
- How to Update PHP Version?
- How to test the website after you update your PHP version for any compatibility issues?
- People Also Asked
Why update PHP version in WordPress?
Updating a WordPress site is absolutely crucial these days to keep up with all the challenges that come with owning a website.
You will need to update core WordPress, themes, plugins, and PHP. But, why update PHP WordPress version and all of these? Simply put, these updates will keep your website secure, fully functional, and optimised for performance & user experience in the long run.
Many versions of PHP are released in the past few years. Each new version offers many opportunities for website owners and developers, from improving site features to making it on par with security standards. Let’s see why you should update your WordPress PHP to the latest version.
One of the most important things to know is that not updating the PHP version may compromise your WordPress website security. Some newer PHP updates offer better security features and solutions so you can not miss out on them.
Almost everything in the technology field needs to update to cope with changes, scalability, and performance. Sometimes, your WordPress PHP version may not suffice the PHP requirements of a WordPress site: themes, plugins, and features used on your website.
And, if you are trying to build a site that requires features like an online store based on free and paid eCommerce themes you may not be able to use some plugins, extensions, and features. So, for this, you will need to update the PHP to the latest version.
Website Performance and features
If you are using outdated PHP, you might be compromising your website’s performance and user experience in terms of speed, size, and functionality.
Updating the WordPress PHP version makes WordPress CMS more functional, flexible, and versatile.
Need Help to Update PHP Version?
PHP in WordPress Website
PHP is basically what builds WordPress websites. It is used to perform core functions of the WordPress websites like processing data, querying databases, and displaying content. PHP in a sense makes WordPress CMS versatile as you can edit the PHP codes in order to make changes to the website.
A new version offers a lot of benefits for users and WordPress hosting providers alike. However, many hosting providers don’t move to the latest stable PHP fearing that it will break their hosting systems. This can cause efficiency and performance issues for many users who have websites hosted with these providers.
It is better to consider PHP versions while choosing your hosting provider. However, some users simply don’t update PHP versions even if they are provided by their hosting plan providers. Most of them simply don’t know how to get this task done and this article is for them.
PHP Versions History
PHP 8.3 is the upcoming version. Currently, the most stable and updated latest version of PHP is PHP 8.2 which was released on December 8, 2022. It is significantly faster than other PHP platforms and a lot more secure. The best part about this version is that it is updated automatically.
It means that you won’t have to check for the latest updates – something that users had to do with previous versions. PHP 7.4 is also compatible with all versions of WordPress.
You may want to keep yourself updated on PHP by checking into PHP Watch.
How to check your WordPress PHP version?
Here are a few ways to check if you are using the latest PHP for your WordPress site.
Check Hosting Management Panel
One way to check for your WordPress PHP version is through your WordPress admin hosting account control panel. This method is the safest and you will not have to tinker with any source files.
Almost all hosting providers list the PHP details in the control panel. If you have a cPanel enabled on your hosting provider, you can check the PHP version.
Every quality hosting provider will put a piece of information for your PHP somewhere in your control panel. If the version is not clearly labelled, you may just need to refer to the specific documentation of your web host.
If your hosting provider uses cPanel, login, in and select the PHP version. Under the Software section, click on Select PHP Version as we have shown in the image below.
This will show you the current version available and if PHP update is necessary for your website.
Use a WordPress Plugin
WordPress shows the updated PHP error when you are using an outdated version.
The best way to update your PHP is to first check the version that you are using. You can use a plugin to find out the PHP version on your WordPress site.
Download and install the plugin Version Info. The plugin simply shows the version of PHP of your website on the WordPress dashboard.
Use Third-Party Applications or Website
You can also find out the version of PHP of your website by using the Builtwith application testing service. BuiltWith tells about all the plugins you have enabled on your website.
To find out the version number, simply login to the BuiltWith control panel and select Detailed Technology Profile.
It will show you the version of PHP that is currently installed on your website. But there is a catch. Since Builtwith is a third-party tool, it can only detect the version if it is made public by the website admin. If it is not made public, Builtwith won’t show the version of PHP.
Run a PHP file
You may also create and run a PHP code to know your WordPress version.
Step 1: Create a new PHP file with ‘phpinfo()’ function. You can copy the code from below.
Step 2: Save the file as “phpinfo.php”
Step 3: Upload it to your web server
Step 4: Access the upload URL where you saved the file to know your PHP info.
Now that you know of multiple ways to see the version of PHP you are using in your WordPress website, it is time to understand how to update it.
How to Update PHP Version?
To update the PHP version of your website, you will have to back up everything. If you are a beginner, our advice is that you try to update PHP in WordPress installation on the localhost – which means your computer.
Or, you can simply contact us. We are Sydney-based website maintenance experts and can update your website while also optimising it according to your needs.
Step 1: Check your PHP version
Check your PHP version using any of the above methods you would like to make sure the update is necessary. Some tools will also notify you if you need to update PHP in WordPress.
Step 2: Backup Everything
You can use a backup plugin like UpdraftPlus to back up everything available on your website to a third-party server or local storage or Google Drive. Once all the data is securely backed up, copy all the images and documents in your media library to a secure server.
Most backup software doesn’t copy the media library. Even the WordPress export file doesn’t create a backup of the media library.
You can select the media files from Public_HTML > WP_Content > Media Files.
Once you have successfully backed up all the files to a secure location, move to step three.
Step 3: Check If Plugins Are Compatible With the Latest PHP
You can download a plugin to check if your current WordPress themes and plugins will be compatible with the latest PHP release. To do so, simply open download PHP Compatibility Plugin on your WordPress website.
Select the latest stable PHP version from the list and install it on your website. To do so, click the ‘Set as Current’ button.
Once the plugin is installed, it will show you all the WordPress themes and plugins that can work with the new PHP version.
Step 4: Update the PHP Version in WordPress
You can update to latest PHP in WordPress in more than one way. Some of the methods are suited for beginners while some are for experienced developers. Choose a method that best fits you.
Update PHP Version from cPanel
Go to cPanel and then click on ‘Select PHP Version’ and open it. It will show you all the latest versions available for your hosting package.
Select the latest stable PHP version in WordPress from the list and install it on your website. To do so, click the ‘Set as Current’ button.
Your website will automatically update to the latest version. You can check the version from the cPanel by clicking the ‘Select PHP Version’ option or through WordPress. Refer to the ways we mentioned above.
Update PHP in WordPress With SSH
To upgrade to the latest version using SSH, your hosting company should provide you with root access to the server. If you have the root WordPress admin access enabled, you can connect to the SSH with admin credentials.
Once you are inside, add the following codes to move from your current version of PHP in WordPress installation to the latest stable one.
AddHandler application/x-httpd-php74 .php .php5
This will install the PHP 7.4 version on your website.
Step 5: Testing and Verifying the Update
That’s it. You have successfully installed the latest version of PHP on your WordPress website. Now you can check this version on your WordPress dashboard if you have the PHP Version plugin installed.
While PHP versions higher than 7.2 support all the WordPress themes and plugins, there is a possibility that some of your site plugins may not work when you move from your current PHP version to the latest one.
If that is the case with your version, make sure to roll back to the PHP version that was stable.
Or, simply change the plugins if they have better replacements available. Almost all reputable plugins support PHP 7.0 versions.
How to test the website after you update your PHP version for any compatibility issues?
You will have to ensure that your website works appropriately after you update your PHP version.
You can also check the current PHP version of your website with SSH. Simply add the following code:
This will list the current PHP version installed on your hosting server.
If you face any issues in installing the PHP version on your website, we can help you with that. Our expert developers can offer support for all types of WordPress Development.
Whether you want to customize your theme, remove bugs, or optimize your site performance, we have the right support team available.
People Also Asked
Why is it important to know your PHP version?
Because it helps you in determining if you are facing any issues on your website because of your PHP version. The most common issues related to WordPress website performance improvements can be solved with the latest PHP version installation.
What is PHP in WordPress?
PHP is a programming and scripting language used for web development. WordPress core code is written in PHP. So, it is inseparable from WordPress websites.
Do I need to update PHP for WordPress?
Yes, it is super important to update PHP for WordPress sites. The latest PHP versions are released to offer you the latest security, compatibility, and performance updates. Compatibility issues between PHP, WordPress, Plugins, extensions, and the theme can cause a website to malfunction.
What does PHP do in WordPress?
PHP is the programming language that makes up the core functionalities of the WordPress website. If you look into your WordPress core files, you will see some “.php” files. The main function of these files is to retrieve content from your server and use them to build a fully functional website.
Updated on: 3 December 2020 |