How to Update PHP Version in XAMPP5 min read

Step-by-Step guide on how to update PHP version in XAMPP Windows

How to update PHP version in XAMPP

Many web developers, particularly beginners, ask the same question: “How do I update PHP version in XAMPP?” We received many questions on this topic and decided to create a simple tutorial that explains how to easily update PHP version on Windows XAMPP.   XAMPP is a key component for web developers. It’s one the most used stacks by developers to create and test local websites. It is popular because even if the code goes wrong, it doesn’t impact the live web platform. It is a great way to improve your web development skills. This practice is also very common among WordPress developers. Most users still have questions about how to change PHP version in XAMPP or how to upgrade PHP version within XAMPP.

This tutorial will demonstrate how to update PHP version in XAMPP using just four steps. Before you begin, however, it is important that you understand why upgrading PHP version in XAMPP is necessary and when the best time is to do so.

Reasons to Upgrade PHP Versions in XAMPP

There are often differences in the requirements for PHP versions depending on the specifications of your project. Sometimes, it is the users that demand a higher version of PHP. This can make it difficult for you to upgrade it. Most users and developers update their PHP versions immediately after a new version is released to prevent security threats. As a member of various developer communities, I frequently see developers still using older versions of XAMPP (i.e. XAMPP 3.2.1 and older that runs on PHP 5.

They are mainly concerned about updating PHP versions in their current XAMPP, without reinstalling it. PHP 7 has a more extensive set of functions than PHP 5. This is why PHP 7 should be updated as soon as possible. To check the PHP version, type http://localhost/phpinfo.php in your browser, and a new screen will appear with the PHP version information. Let’s take a look at PHP 7, which is a better choice than PHP 5.

  1. PHP 7 is faster than any version of PHP 5, for starters. Imagine that you’ve written PHP code in PHP 5. Now, PHP 7 will make it faster than any other version.
  2. PHP 7 is more efficient than older PHP versions in handling errors. You would be able to see how difficult it is to correct fatal errors if you’re using PHP 5.
  3. PHP 7 now supports the anonymous classes. This feature isn’t available in older PHP versions. Anonymous class can be used to speed up execution time, which is also common in OOP languages such as JAVA and C#.
  4. PHP 7 supports 64-bit (large) files that can be run on 64-bit OS architecture. This feature is not available on PHP 5.
  5. PHP 7 includes null coalescing operators, type declarations that are precise, and many other advanced features.

We now know how important it is for PHP versions to be updated in XAMPP.

  • Let’s continue and learn how we can do this in just 4 steps.
  • PHP 7.0.0 was released on December 3rd, 2015. It has a number of other advantageous characteristics, which I will list below:–
  • PHP 7 is nearly twice as fast as the previous versions of PHP.
  • Memory consumption is very low.
  • makes it easier to deal with errors
  • Support for 64-Bit Windows Operating Systems
  • Operators for a new spaceship and null coalescing are introduced.
  • Allows for Accurate Type Declarations to be made.
  • Classes with no names are added.
  • Imports from the same namespace are made easier with this feature.
  • Null coalescing, the Spaceship operator, and other features are now available.
  • More information can be found at http://php.net/manual/en/migration72.php.

Now I’m going to show you how you can get out of this situation successfully. php-5.6.36 is the version of PHP that I am currently running.

In 4 Easy Steps, How to Update PHP Version on Windows XAMPP

The beauty of XAMPP is that it’s a development and not a production server. You can modify its configuration, such as changing the PHP version, without impacting your live application. Note: Before you upgrade PHP version to XAMPP, I recommend making a backup of your site files and project files. ALWAYS MAKE A BACKUP FOR DATA. It is easy to update PHP version in XAMPP. These are the steps to follow.

Step 1: Download the most recent version of PHP (i.e. PHP 7.x

To download the most recent binary version of PHP, click here. As you can see, the Thread Secure Zip file depends on your Windows version ( x86 for 32-bit or x64 64-bit),   The above image shows that I downloaded the VC14x64 Thread Secure as my Windows version is 64-bit.

Step 2: Extract the Zip File, and create a PHP Folder

Next, create a folder on your Windows desktop with the name PHP. Next, extract the Zip file to that folder (i.e. PHP.

Step 3: Rename the old PHP folder

Next, open XAMPP folder. Select the php folder. Rename it with something like php_5. Then paste the extracted-new php folder to XAMPP directory. As you can see, I did this as shown in the image below.

Step 4: Configuring Apache Server

Next, configure the Apache web server. To do this, open your control panel and click on Apache Configure > Apache . (httpd-xampp.conf).   An httpdxampp.config will then open on your screen. The PHP Module setup will open. Next, copy the new lines of code into the HTML-Module setup . Finally, remove the old lines of code as shown in this image.

Previous lines:

LoadFile”D:/xampp/php/php5ts.dll”

LoadFile”D:/xampp/php/libpq.dll”

LoadModule php5_module”D:/xampp/php/php5apache2_4.dll”

 

LoadFile”D:/xampp/php/php7ts.dll”

LoadFile”D:/xampp/php/libpq.dll”

LoadModule php7_module”D:/xampp/php/php7apache2_4.dll”

Next, save this file and restart the XAMPP Server. It’s done! It’s done.

Summary

If you want your WordPress website to work smoothly, updating your PHP version is a must. While this article outlined how to manually update your PHP version, there is WordPress maintenance services that can take care of these tasks so you can concentrate on your business. This tutorial will teach you how to update PHP version in XAMPP.

Rate this post

Leave a Reply