How to update php version to 7.0. How to update the PHP version on the server? Why WordPress Doesn't Require PHP Updates

If you want your blog, your website or your Boutique en Ligne works fine, it would be ideal to consider changing or updating the version of PHP you are using on your site. The new version of PHP (PHP7) is not widely available yet, but it won't be long since it brings a lot of innovations and is very likely required to install or use the next version of WordPress.

This article assumes that you have already created a WordPress website or blog. .

But if you've already done that, let's continue.

Why should you upgrade to PHP 7?

If you're using WordPress on your server, you obviously already have PHP installed. So, why upgrade when everything works so well?

Here are some of the most common reasons why you should consider upgrading your PHP version:

  • . plugins And scripts the versions you have installed are no longer compatible with the version you are using
  • Minimum requirements to run WordPress have increased
  • The version you are using has security flaws and the update includes a patch
  • You need a more stable version
  • Do you want to test a different version when installing WordPress or in a staging environment?
  • You have detected a conflict between the version you are using and the plugins, themes or scripts you have installed.

These are all good reasons, but before you upgrade your version of PHP, there are downsides that you should consider...

Some important disadvantages to consider...

Upgrading to a newer version of PHP comes with some risks. Here is a premium WordPress plugin that will completely save your website and restore it in case of failure.

The main thing you need to keep in mind before upgrading is that all your plugins, themes and scripts are not necessarily compatible with the latest version of PHP you want to use.

If there is incompatibility, it is likely that your site no longer works or you are seeing a lot of errors. Additionally, WordPress now tells you whether the plugin is compatible with your version of PHP or not.

Each version of PHP offers new variants, improvements and fixes, security fixes and code structure. While some updates are less comprehensive than others, many versions offer improvements or modifications that make some parts of older versions obsolete.

Discover

In some cases, entire versions, such as PHP 4 and above, are no longer supported. If your website uses plugins, themes, or scripts that depend on outdated PHP code, and you upgrade to a newer version of PHP, the upgrade will render the code obsolete and thus stop working. your blog.

In addition to manually checking your website for possible weaknesses, there are many plugins that tell you whether your environment is compatible with the update. The good news is that you can downgrade a previously activated version. In other words, if you notice any errors, it is still possible to restore a previous version of PHP... so, for example, go to version 5.5 of version 7.x, and if everything doesn't work, you can go back to version 5.5.

Check PHP Compatibility

Here are some plugins you can use to check your environment's compatibility with the updated version of PHP:

  • PHP Compatibility Checker- This plugin allows you to detect the PHP version and do an analysis compared to your host's current PHP version. It also generates a report to tell you what to fix.
  • Error Log Monitor- If there are errors, you can activate the log to keep track of all errors, which will help you fix them more easily.

You can also activate manual newspaper private errors with "WP_DEBUG" You can also see what changed for each version of PHP before the update:

  • Migration from PHP 4 to PHP 5.0.x
  • Migration from PHP 5.0.x to PHP 5.1.x
  • Migration from PHP 5.1.x to PHP 5.2.x
  • Migration from PHP 5.2.x to PHP 5.3.x
  • Migration from PHP 5.3.x to PHP 5.4.x
  • Migration from 5.4.x PHP to PHP 5.5.x
  • Migration from 5.5.x PHP to PHP 5.6.x
  • Migration from 5.6.x PHP to PHP 7.0.x
  • Migration from 7.0.x PHP to PHP 7.1.x
  • Migration to the latest PHP version

If you find that you are using a plugin, theme, or script that is incompatible with the version of PHP you want to use, you can contact the author or developer to help you resolve the issue. If you need a hand, you can leave a comment on this article, I will be happy to provide you with answers.

How to change PHP version

So, once your blog has passed the compatibility test, you can change the version of PHP you are using via SSH or cPanel. If this is not an option you have access to, please contact web hosting In most cases, they can update you or perform other tasks.

Update via SSH (advanced users)

Because SSH commands for updating or installing other versions of PHP vary depending on the type of server, there are no universal commands that work everywhere.

Protect your blog or website with our guide:

Click on one of the resources below to view detailed information about your server type:

  • Unix systems
  • Mac OS X
  • Windows systems
  • Cloud Computing Platforms

Keep in mind that if you use the commands in these links, you must also remove the old PHP package from your server. Since the commands to remove older versions will also depend on your server type, check your server's documentation for the exact commands.

Updating or Changing PHP in cPanel

If you prefer to choosein a few clicksPHP version for your server, you can do this by logging into your cPanel account. However, this option is only available in the default versions of cPanel. If this is not the case at home, you will need to contact your web hosting provider for this.

I'll show you how to access it from your control panel. Once you are logged in, go to the Software section and click on MultiPHP Manager.


Clicking on it will take you to the PHP version for the various available domains and subdomains. All you need to do is select the correct PHP version and apply it to the domain of your choice.

If you use Denwer, then you know that package updates do not happen very often. If the server itself may not worry us much, then here is the version php could become a critical problem. That's about how to update PHP on Denwer, we'll talk today.

In fact, there is nothing difficult here. First you need to download thread safe version php on the website http://windows.php.net/download/. I advise you to download the 32-bit version, because... with 64-bit you may have problems, and this build is currently experimental.

Now stop the server using the script stop.exe And switchOff.exe, then follow the path usr/local/php5 and delete all binary files there, replacing them with the ones you just downloaded. Restart Denwer.

Now in the folder php5 you don't have a file php.ini, however, instead of it there is php.ini-development And php.ini-production. You can rename any of them to php.ini and configure the server as you need. Don't forget to also see that the directive is uncommented extension_dir="ext" to avoid problems with plugins in the future.

Updating php to the latest version will, first of all, ensure faster and more reliable operation of the site, page optimization and an improved structure according to search engines. But not everyone is able to carry out this update correctly.

We’ll talk about when and how, and most importantly, why to switch to a new version of php and not make mistakes, in this post.

When to upgrade to the latest version of php

You can find out about the need to update the php version yourself ( check download speed), and having received a notification from your hosting provider. In addition, when using ready-made engines, you can enable the system debugging mode and when installing extensions that use an old version of php, the system itself will issue a warning.

You can also check the site code for errors using validator (). Another way of incompatibility is installing extensions for your engine. This is especially true for new or updated extensions (if created in PHP). Everything is always new in them, including the PHP code itself.

Reasons to update php

It is necessary to note the 2 most important reasons - the security and performance of the entire site. Just recently, all administrators knew about the termination of updating php version 5.2, and now, after just a little less than two years, the php programming language is already available in version 7.

In simple terms, the PHP core has been completely updated, new functions have appeared and old functions have been simplified. As a result of the increase in data transfer, the speed of operation has also increased.

Owners of self-written websites using PHP also need to take care of switching to a new version, but this is a separate topic and owners who have written such a website on their own know how to do this.

As for administrators who are only involved in managing such sites and do not have the necessary knowledge, here it is necessary to contact the owner of the site or the programmer who created the engine.

How to find out php version

First of all, any administrator needs to have complete information about his software with which the site runs, including the PHP version, if, of course, this is the programming language used to run the project.

There are quite a few ways to check, the simplest are directly checking the php version in your hosting account and the second is creating a file to check the php version.

Every website owner knows everything about a hosting account, but let’s take a closer look at checking using a file.

To do this, create a file in any editor with the following content:
and save it under the same name phpinfo.php

Then you need to upload the data file to the root of your site and access it in the address bar of your browser (http://your_domain/phpinfo.php).

As a result, we will receive all the necessary information regarding not only the php version, but also everything that is needed for the administrator.

Updating php on the server for wordpress

All popular cms systems, including wordpress, are frequently updated and have the latest version of the programming language and often new functionality. This is primarily due to security and software code updates.

Using this example, we will look at the practice of updating php directly on the hosting. It’s good that owners of cms systems do not need to update the entire cms program code; there are developers for this.

But setting up compatibility between versions of PHP hosting and, for example, Wordpress, is a matter for the site administrator. Actually, this is why this article was written.

Any administrator knows that updating php on the server is done from the hosting control panel with two mouse clicks. I selected the required php version and clicked the “save” button.

In most cases, this happens due to the incompatibility of installed extensions with the latest versions of php. Therefore, it is important to monitor updates and try not to install extensions that have not been updated by the developer for a long time.

It is not at all important to know the structure of WordPress or another engine, but it is enough to understand that all changes occur precisely for this reason.

If so, then the whole thing needs to be checked. But there can be more than a dozen extensions (plugins for Wordpress) and checking such a number for compatibility is simply not realistic!

What should I do?

Checking extensions for compatibility with php 7

Oddly enough, but for WordPress, for example, you can install another plugin Compatibility php, which will help you find out which installed plugins prevent the system from working normally.

This is a great and easy way to check the compatibility of your site with PHP 7. And you can check almost everything, including a WordPress theme.

The installation is standard and after that an additional PHP Compatibility tab will appear in the toolbar.

The plugin will check all installed engine plugins for compatibility, which will allow us to reduce the time spent searching for incompatible extensions.

To take a closer look, click on the image.

The screenshot shows that after clicking on the “Scan site again” button, the plugin displayed all the information on the installed extensions. The multi-colored test result is clearly visible.

The contents of suspicious plugins can be viewed by clicking on the link on the right and you can see the address of this error.

Thus, out of 23 installed plugins on the blog, you need to disable or remove only 3. This way, you can ensure that the php update will go without problems.

If you don’t mind the time, you can manually remove or disable all plugins, and after setting up the server on PHP 7, gradually enable them one by one and check their operation.

In this case, you need to either remember all the settings, or have a file with saved settings.

Updating php joomla version

As for cms-joomla, it is probably already clear that the procedure for updating the php version looks approximately the same. There are quite a lot of options, but the most important thing is that the entire system is already running on the latest version of php after joomla 3.7 was released.

In this case, a message about php incompatibility will appear in the admin panel, regardless of which server the system is running on, local or remote.

As for installed extensions, often in joomla there are no more than 5-7 extensions that need to be updated.

And information about the update can always be seen in the admin panel, but if some extensions have not been updated for a long time, you should pay close attention to this.

From December 2018, WordPress sites that use PHP 5.6 and 7.0 will no longer receive the update, which is 57.1% of the total number of WordPress sites. Website security patches will not be released on the above PHP versions.

This can result in decreased traffic and poorer search rankings for WordPress websites that are still using these old versions of PHP.

What is PHP?

PHP is a programming language that allows you to create websites. There are different versions of PHP, each of which is an improved version of the previous one. With the creation of new versions, it is possible to update to take advantage of all the benefits of the new version of PHP.

When will security updates end?

Security updates for PHP 5.6 end on December 31, 2018.Security updates and patches for PHP 7.0 end on December 3, 2018.

How many websites face a security problem?

According to official statistics, 57.1% of all WP sites use PHP.

Why is support ending?

Security support for each version is planned for a limited number of years until it reaches what is called the “End of Life (EOL)”. What does it mean that there will be no improvements or updates for WordPress sites running older versions of PHP, even if vulnerabilities are discovered? According to the official PHP website, the term EOL means:

“A release that is no longer supported. Users who are still using this version should update as soon as possible to avoid any vulnerabilities."

What happens if you can't update PHP?

All websites that cannot update to the latest version of PHP will be insecure and vulnerable to hacking after the end of support for versions 5.6 and 7.0. This means that if CMS system vulnerabilities are found, no one will be involved in eliminating security holes in the PHP version at the EOL stage. Also, many WordPress plugins and themes will stop working.

If you have a website written in WordPress, then you should find out as soon as possible which version of PHP you are using and, if possible, update it. To do this, contact the technical support of your hosting provider.

How to check which version of PHP you are using?

The easiest way is to go and find the section related to PHP.

There are also many tools for checking the PHP version online, but we recommend checking through the hosting control panel. HyperHost hosting uses two popular control panels Cpanel and ISPmanager; you can check the PHP version in the corresponding section as in the screenshots:

in the cPanel control panel



in the ISPmanager control panel

There are plugins within WordPress itself that can tell you which version you are using. For example, the WordPress phpinfo plugin is used to determine the PHP version of a site. After determining your PHP version, don't forget to remove this plugin.

Well, the easiest way to determine the PHP version is to contact our technical support, we can tell you exactly what version you are using and help you update it.

How to upgrade from PHP 5.6/7.0 to the latest versions?

  1. Back up your site

It's a good idea to make a backup before making any changes. You can create a backup using the UpDraftPlus plugin, yourself through the control panel or by writing to our technical support.

  1. Check plugin compatibility

Check or update all plugins to the latest version. The last update to the plugin should be no more than a year old. If the plugin has not been updated for a long time, contact the plugin author or find information about whether the plugin works with the latest version of PHP 7.2.

If the plugin is not compatible with this version, then it should be replaced with a similar one that supports updates and is compatible with the latest version of PHP. Plugins that are not updated pose a serious security risk.

  1. Updating PHP Version

Go to your cPanel or ISPmanager hosting control panel, go to the PHP section and update the PHP version for your site. If you know how to do this, write to us, we are always ready to help. Create a ticket in the “Tickets” section, “Open a new ticket”, select the technical support department and indicate which version of PHP you need.

Make security part of your SEO efforts

Security issues are usually not part of SEO as they do not directly affect rankings. At the same time, if the site is hacked, then the traffic to your site decreases, which directly affects the SEO. Therefore, you should not wait for force majeure, but add one more check point to your SEO list - checking the security of the site.

Translation from searchenginejournal.com

3249 times 4 Viewed times today

What if you could double your WordPress website loading speed in just 10 minutes? Sounds good?

It's easy - all you need to do is update PHP to the latest version.

And soon you won't have a choice anyway, since PHP 5.6 will become the minimum requirement for WordPress in April 2019, and will be replaced by PHP 7.0 in December 2019.

PHP is one of the most popular languages ​​on the Internet. In fact, 70% of all websites use PHP on the server side.

WordPress sites also run on PHP. But the big problem we face in the WordPress community is that many sites, companies, hosting providers and developers do not support the latest versions of PHP. This is especially frustrating considering how easy it is to update PHP on the server.

WordPress and PHP problem

Soon, 8 out of 10 WordPress sites will be running a version of PHP that is no longer supported.

According to WordPress.org statistics, 35% of WordPress sites run on PHP 5.6. Active support for PHP 5.6 ended on January 19, 2017, and it will officially end its lifecycle on December 31. This means that it will no longer have security support, and sites that continue to use PHP 5.6 will have unpatched vulnerabilities.

Additionally, there is PHP 7.0, which reached end of life on December 3, 2018. It is also no longer a supported version of PHP. However, almost 20% of WordPress sites run on PHP 7.0.

Like any software, PHP has a life cycle. Each major version of PHP is typically fully supported with bug fixes and security fixes for two years after its release.

Also, about 25.2% of sites are already running on unsupported older versions of PHP, including 5.2, 5.3, 5.4 and 5.5.

Thus, at the time of writing this article, about 80% of WordPress sites are running or are about to run with an unsupported version of PHP.

Only 20% of WordPress sites run on the latest supported versions - PHP 7.1, PHP 7.2 and PHP 7.3.

Why are so many WordPress sites still running on old versions of PHP?

There are many reasons why websites continue to run on outdated and unsupported versions of PHP, here are the most common ones.

1. Website owners don't know or care about their server or hosting software

For many website owners, especially those without technical knowledge, it is important that their website simply works and looks good. Why update some PHP when everything works already?

2. It is time consuming for plugin and theme developers

For developers of older plugins and themes, upgrading to the latest versions of PHP means updating their code along with full testing to ensure compatibility if they don't want to break their users' sites.

3. Hosting providers do not want to disrupt the performance of sites

Even though PHP 5.6 was released in 2014 and support for PHP 7.0 is coming to an end, web hosts have delayed updating their servers to the latest versions of PHP (7.1 or 7.2) due to the danger of breaking plugins and themes.

This means that if you want your site to run on the latest version of PHP, you need to take the initiative to update it yourself, or ask your hosting provider to help you.

Why doesn't WordPress require PHP updates?

The WordPress project did not force users to use the latest versions of PHP for a number of reasons. That's all we covered in the previous section, along with the responsibility of managing the world's most popular CMS.

But everything is set to change in 2019.

At WordCamp US in December 2018, it was announced that PHP 5.6 will become the minimum supported version in the first half of 2019, and will be increased to PHP 7.0 in the second half of 2019.

These changes have been a long time coming, and we can thank the Yoast palgin developers for playing a big role in encouraging users to update PHP. In early 2017, with the release of Yoast SEO 4.5, a notification was added to the WordPress dashboard for Yoast users. It urged website owners whose sites were on a server with an outdated version of PHP to update it to the new version. It was possible to disable the notification only by updating PHP.

Most recently, in early December, WordPress core contributor Gary Pendergast suggested updating the minimum PHP versions. The plan, which Matt Mullenweg confirmed at WordCamp US, will make PHP 5.6 the minimum required version for WordPress by April 2019, with PHP 7.0 becoming the minimum as early as December 2019.

Why you should upgrade to PHP 7+

PHP 7.2 is now not only officially included in the list of recommended requirements for WordPress, but also has many advantages in respect of speed, performance and security .

1. Speed ​​and performance

If your site is running on an older version of PHP, upgrading to the latest version will give you an immediate performance boost - more than any other WordPress site tweak.

When PHP 7.0 was released, it was praised for its significant performance improvements. In fact, an official PHP test using WordPress 4.1.1 shows that PHP 7.0 allows servers to perform twice as many requests per second as PHP 5.6 with half the latency.

We recently compared PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2 and PHP 7.3. Their results show that PHP 7.3 executes 3 times more requests per second compared to PHP 5.6.

If you need further evidence of performance improvements, there is one that showed that PHP 7.3, released in late 2018, is about 5% faster than PHP 7.2.

2. Support and compatibility

Compatibility is another important reason why you should use the latest version of PHP. As with any software, developers will only support older versions of PHP in their plugins and themes for a certain period of time. This will make it a disadvantage for plugin and theme developers to actively support older software and ensure backward compatibility.

In fact, problems with older versions of PHP crop up regularly on the WordPress.org support forums. If you search for "T_Function", the search will return over 2,700 results.

As WPMU DEV developer Predrag Dubajic explains, in the Hustle plugin, T_Function errors typically appear when the user has an outdated version of PHP:

3. Security

Another fundamental reason why you should update PHP is for the security of your WordPress site. Using the latest version of PHP ensures that your site is protected from vulnerabilities found in older versions of PHP.

For example: According to CVE's security vulnerability data, 18 known vulnerabilities have been discovered in PHP this year. In 2017, 43 vulnerabilities were discovered, and in 2016, a whopping 107 vulnerabilities were discovered.

These vulnerabilities include DoS, code execution, SQL injection, XSS, and many other types of exploits.

Checking PHP Compatibility

We hope we have convinced you of the benefits of upgrading to the latest version of PHP. But before you start updating, there are a few things you need to do: check which version of PHP is being used, and also check that your site is compatible with the latest version.

Don't know what version of PHP your site is running on? Here's how to check the PHP version on WordPress.

Install the free Display PHP Version plugin, which can be downloaded from the WordPress plugin repository. When you activate this plugin, it will display the PHP version in the At a Glance widget in your WordPress dashboard.

Before upgrading, you should also check that your plugins and themes are compatible with the latest version of PHP. To do this, you can use the WP Engine PHP Compatibility Checker plugin. This plugin scans your site and checks which plugins are compatible with the three latest versions of PHP.

Once the scan is complete, it will display a list of your plugins and highlight any that contain code from older versions of PHP that is now incompatible with the version you just tested.

If you find that any plugins you are using are incompatible with the latest version of PHP, or are giving you unknown results or warnings, contact the plugin author for support.

How to Update PHP on WordPress

Once you've checked your WordPress site for compatibility - and made a backup - you're ready to update your PHP version.

1. Updating PHP using cPanel

If you are using a hosting that provides a control panel cPanel, you can simply log into cPanel and change your PHP version there.

All you have to do is scroll down to the Software section and select Select PHP Version.

On the next page, select the version of PHP you want to use and click "Set as Current".

That's all you need to do. Update your site to make sure it works fine, but if you've checked compatibility, your site should be fine.

2. Updating PHP on your own server

If you manage your own server, you can upgrade to PHP 7.2 yourself using the migration guides provided in the php.net documentation. It's important to pay attention to new features and functionality, as well as any legacy features that may impact your site.