Skip to content

How to know and update the PHP version in WordPress

Alejandro Frades
Cómo saber y actualizar la versión PHP en WordPress

The PHP version being used on your WordPress site can have a significant impact on the speed, security, and overall performance of your site. In this article, we’ll explain the importance of keeping your PHP up to date, how to do it, and what to do if you encounter problems during the process.

PHP in WordPress

What is PHP?

PHP is an open-source programming language that is used to create dynamic content on websites. WordPress, a content management system, is written in PHP.

Where is PHP installed?

PHP is installed and runs on your website’s server. Therefore, any change in the PHP version affects your entire site.

How does WordPress use the PHP version?

WordPress uses PHP to generate dynamic content. Themes, plugins, and the WordPress core are written in PHP. That’s why it’s essential to keep PHP updated to ensure everything works properly.

Why update the PHP version of your WordPress site?

Keeping your WordPress site updated with the latest PHP version can offer you a number of advantages:

  • Improvement in loading speed.
  • Compatibility with recent plugins and themes.
  • Increase in security by using the latest fixes.

It’s always advisable to make a backup before performing any major updates, including PHP. If you don’t know how to do it, I recommend this article “How to make backups in WordPress”

How to know the PHP version that my WordPress has?

Knowing the PHP version that your WordPress site uses is crucial to ensuring optimal compatibility, security, and performance. Below, we detail different methods to determine the PHP version that is in use on your WordPress.

1. Using a plugin

There are several plugins in the WordPress repository designed to display the PHP version that your site is using. A popular example is “Display PHP Version“. Follow these steps:

  1. Install and activate the “Display PHP Version” plugin.
  2. Go to the WordPress administration panel. Here, the plugin will directly display the PHP version in use.

2. Through your hosting control panel

In most web hosting companies, you can verify the PHP version from your account control panel. This method varies depending on the hosting provider but is usually found in the “Server Information” or “PHP Details” section.

3. Using the Info.php file

You can create a file called “info.php” at the root of your website with the following code:

<?php
phpinfo();
?>

After saving and uploading this file, visit “yourdomain.com/info.php”. It will show you a page with all the information related to PHP, including its version. For security reasons, remember to delete this file once you have obtained the information you need.

4. From the WordPress site health area

Since WordPress 5.2, there’s an integrated feature called “Site Health”. You can go to Tools > Site Health > Information and find the PHP version in the “Server” section.
Knowing the PHP version will allow you to stay on top of the necessary updates and ensure that your WordPress site operates with the greatest efficiency and security possible.

How to update PHP versions in WordPress

To update PHP on your WordPress site, you usually need to access your hosting control panel. From there, you can select the PHP version you want and apply it to your site.

How to update PHP versions in WordPress

Updating PHP in your WordPress is an essential task to ensure optimal performance and security of your site. However, it is important to approach this process with caution to avoid possible incompatibilities. Below, we guide you step by step on how to perform this update safely and efficiently.

1. Make a backup

Before making any significant changes to your site, it is crucial to have an up-to-date backup. This allows you to restore your site to its previous state in case of problems. You can use plugins like UpdraftPlus or do it manually from your hosting control panel.

2. Check compatibility

It is essential to make sure that your themes and plugins are compatible with the new PHP version you plan to use. Some plugins, such as “PHP Compatibility Checker“, can help you verify this.

3. Access the control panel of your hosting

Most of the time, the PHP update is performed from the hosting provider’s control panel. Access your account and look for options related to “PHP” or “PHP Configuration.”

4. Select the new PHP version

In the control panel, you will usually find a section where you can view and select the PHP version you want to use. It’s advisable to update to the latest version, but make sure it has been tested and is stable. Once selected, save the changes.

5. Verify the site

After the update, browse your WordPress site to check that everything is working correctly. Pay attention to details such as page loading, plugin functionality, and content display.

6. Solve possible problems

If you find errors or incompatibilities after the update, consider the following solutions:

  • Deactivate plugins one by one to identify possible conflicts.
  • Try switching to a default WordPress theme.
  • If you can’t solve the problem, consider restoring your site from the backup and contact an expert or your hosting support.

Updating PHP on your WordPress is a task that, although may seem complex, is essential to maintain the health and performance of your site. By following these steps and approaching the process with caution, you’ll ensure a smooth and trouble-free transition.

Troubleshooting when updating PHP in WordPress

If you encounter problems after updating PHP, some steps you can follow are:

  • Deactivate all plugins and reactivate them one by one to identify the conflict.
  • Switch to a default WordPress theme to rule out theme issues.
  • Restore your site from a backup if you cannot resolve the problem.

Frequently Asked Questions

Is it safe to update PHP by myself?

Yes, but it is always recommended to make a backup before performing any updates.

How do I revert to a previous version of PHP if something goes wrong?

You can revert to a previous version of PHP via the control panel of your hosting provider or restore your site from a backup if you made one before the update.

Can I update PHP without updating WordPress?

You can update PHP without updating WordPress, but be cautious as older WordPress versions may not be compatible with newer PHP versions.
Keeping PHP updated on your WordPress site is a crucial task for optimal performance, compatibility, and security. By understanding the process and proceeding with caution, you’ll contribute to a faster, safer, and more efficient website. If you have any other questions or need further assistance, don’t hesitate to reach out to your hosting provider or a WordPress specialist.

Autor
Alejandro Frades
Marketing Specialist
The mind behind Modular's social content. Always on top of the latest trends to take advantage of them and make the digital world more enjoyable and entertaining.

Subscribe to our Newsletter about the web world