How to update the PHP version on the server? Updating PHP for a blog on WordPress, step-by-step instructions for beginners Update the php version on the server to 7.5.


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.

Your WordPress site can run faster and become more secure, and it's in your hands!

This page will try to explain why this means for you, and how you can fix it.

Why PHP is significant

PHP is the programming language that WordPress is based on. The PHP version is installed at the server level by the system administrator. While you may be aware of the importance of keeping your WordPress, plugins, and themes up to date, keeping your PHP version up to date is equally important.

There are two important reasons to have the latest version of PHP:

  • Your site will run faster, since the latest versions of PHP are more efficient. Updating to the latest supported version of PHP (currently 7.3) can speed up the site up to 3-4 times compared to older versions.
  • Your site will be safer. PHP, like WordPress, is supported by its community. Since PHP is so widespread, it is a priority target for hacking; only the latest supported versions will have the latest security features. Old, unsupported versions of PHP don't have them, so updating PHP is required to keep your WordPress site secure.

But that's not all, there are other advantages:

  • A fast website gets advantages in search engines, so you will get a higher ranking in search!
  • A fast website retains visitors better. Visitors leave faster from slow sites; a fast site is more effective.
  • A secure website is better protected from hacking and damage to reputation in case of hacking.

These benefits are good for both you and site visitors. These are the reasons why you should update PHP as soon as possible. In the next section we will tell you how to do this.

Before updating PHP

First, a few warnings, but no need to be alarmed. There are some technical things you need to do before upgrading your PHP version.

Updating the PHP version itself shouldn't be a big problem, but we we can't guarantee that it will pass without problems. WordPress works even with a version as old as 5.6.20 (even though we recommend 7.3, we have excellent backwards compatible!), but we don't know how your plugins and themes will work. They should, the most popular or reputable plugins and themes are likely to be, but again, we don't guarantee this.

Below are a couple of steps you can take to reduce your risk before upgrading:

  • Make a backup copy of the site:, this will allow you to rollback the site in case something goes wrong. There is, so if you haven't yet decided on a solution for yourself, then try one of these. To complete the rollback, you will also need to return the current version of PHP (we will tell you how to do this a little later).
  • Update WordPress, themes and plugins: from the WordPress console, go to Updates and update everything. This is something that should be done regularly anyway. Once the updates are complete, make sure the site is working as it should.
  • Check PHP compatibility: install a plugin to check your themes and plugins for possible problems. The plugin is not perfect and may miss things or give false positives, but in most cases it works.
  • Fix PHP compatibility issues: If the plugin found problems in the previous step, contact the theme or plugin developers and ask them to sort it out. If they don't want to or can't do this, then look for other themes in the directories with similar functionality and use them instead of the problematic ones.

Take these few steps and you'll be ready to upgrade the PHP version of your WordPress site to reap all the benefits it brings!

If you encounter any difficulties during the process or need help, then it is better for you to contact a professional web developer, support from your hosting provider, or the authors of your plugins and themes. Most of them should be happy to help you.

And now we can finally move on to updating the PHP version on your site.

How to update the PHP version on a website to make it faster and more secure

Now you are ready to update the PHP version on your website! You've done your due diligence, you have a backup and your site is prepared to be updated in the best possible way.

Since the PHP version is installed at the server level by your hosting, the update occurs either by changing the settings in the hosting panel or by contacting the hosting technical support with a request to change the PHP version.

So the exact steps to update will vary depending on the hosting provider. Below is , which provided us with instructions (in English) on how to update PHP for them.

If you do not find your hosting in the list, you can contact hosting technical support and ask them to help you. Below is a request template you can use:

Dear hosting support!

I want to make my WordPress site faster and more secure with the latest version of PHP.
If my site is not already using the latest version of PHP,
then please tell me what step by step I need to do to update.

Thank you!

If you have any difficulties at this stage, then either change the PHP version back yourself, or contact hosting support or a professional web developer. If you need to roll back to a backup, first restore the previous version of PHP you were using (possibly by contacting hosting support), then restore the site from the backup.

You now have all the information on the update! Great! With the latest version of PHP, your site will be faster and more secure, and your visitors will be happier.

Fast, Secure WordPress Websites for Everyone

With the latest version of PHP, you can be sure that your site is as fast and secure as possible.

You now have all the information to update PHP and you also know how to do it in the future. Keep an eye out for update notifications in your WordPress site console, or for updates from your hosting service.

Thank you for making the Internet better!

Best the enemy of the good? We looked at how to update the version of PHP your site is running on and why you need it.

Current PHP version

PHP 7.3, the latest release in this family, is currently undergoing beta testing. The current version is 7.2, which is superior in speed and functionality to all previous versions.

Here is a partial list of PHP 7 features:

  • scalar parameter types and hints (hints) by return types;
  • two new features CSPRNG;
  • anonymous classes;
  • operator return in generators and other updates in them;
  • improvement of function assert() while maintaining backward compatibility.

How to update PHP on Windows

Everything here is very simple and prosaic:

1. Download the latest version of PHP

2. Delete the old one

3. Install a new one.

4. We re-register the settings in Apache and PHP.

But before updating, you need to carefully study the Appendices section in the documentation for the new version. It describes deprecated functionality that is no longer used in the language. New versions do not support the old code: migration from the fifth to the seventh, which has very weak backward compatibility, is especially difficult.

If a developer uses unsupported functions, then the piece of code that contains them simply will not work. Therefore, before updating, you need to seriously analyze this section and, in accordance with it, your code.

Why update if everything works?

A reasonable question that many programmers ask. If you do not update the language on your own server, you are simply depriving yourself of the benefits and capabilities of the next version.

With each PHP release, new features and functions appear, and vulnerabilities are also closed. For example, is_countable allows you to determine the type of a variable - enumerated or not. This is a very convenient feature for web developers. Now we have to use it to determine the type of a variable if, and in PHP 7.3 this can be done with one function.

However, updating a PHP version is a painful process for the development team, meaning days of code refactoring and bug fixes - all due to backward compatibility issues in the language. Previously installed plugins and scripts may conflict with the new version, work incorrectly or not connect at all, adding headaches to developers.

Web hosting Plesk posted statistics on its blog on Habré about which versions of PHP their users use on their websites. At the beginning of March 2018, the situation looked like this:

Statistics on the use of different PHP versions

As you can see, very few people use the latest version. The conservative majority remains faithful to reliable technologies - from PHP 5.1 to 5.6.

To update or not to update: that is the question

Let's put it this way: there is no Holy Grail in the update problem. It must be approached from a position of expediency. It will be difficult to transfer a large project to PHP7: you will have to refactor the entire code base, but for what? Any change must be based on work needs.

If there are no problems with maintaining the functionality of the site and loading speed, then switching to a more modern version is a waste of time and money. If the developers lack everything in functionality, there is no point in updating either. The transition to a new version should not be justified by the fact that it is cool, fashionable and youthful.

On old sites where there is solid

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.







2024 gtavrl.ru.