How to Upgrade PHP Version 7 to 8 in Xampp (PHP 8 Latest Version)

php-8-latest-version

Upgrade PHP Version 7 to 8 in Xampp: Here we have the latest version in PHP with many updates and improvements. Many web developers, especially beginners, have a common question “How to update PHP version in XAMPP?”. After getting a lot of queries on the topic, we decided to write a short and simple tutorial on how you can easily update the PHP versions in Windows XAMPP.

It is not very complex but sometimes very essential when we need the latest version of PHP for a new project without changing the current local server settings. So, I am trying to cover changing the version by keeping the old version manually.

Latest Version of PHP in 2021

Now we have the PHP 8.0.2 version and more latest versions will be on the way. And PHP 8 has many features as given below.

  • PHP 8.0 is a major update of the PHP language.
  • It contains many new features and optimizations including named arguments, union types, attributes, constructor property promotion, match expression, null safe operator, JIT.
  • PHP 8 has improvements in the type system, error handling, and consistency.
  • PHP 8.0 improves speed and compiling.

Upgrade PHP Version in xampp

 

Now, I am going to tell you How to Upgrade PHP Version 7 to 8 in Xampp

Step1: Download PHP 8.0.2 Version from its official website. click to download PHP 8.0.2.  You need to download Thread safe version.

Upgrade PHP Version in xampp

after download the PHP latest version. you need to create a new folder named “php” and extract the downloaded zip inside the PHP folder you recently created.

 

Step 2: Go to your XAMPP installation directory ( C:\xampp\php ) and rename your old PHP directory with an old version prefix like PHP to PHP_old or PHP_7_4. Now copy & paste the extracted new PHP folder here. You can see this in the given image below. I have changed my PHP folder name to php7.2. and the PHP folder is the latest version.

 

 

Step 3: After the rename of the old php folder to php7.2 or something else. Now you need to move the new “php” to xampp directory.

Upgrade PHP Version 7 to 8 in Xampp

 

Step4: Next, open httpd-xampp.conf from the XAMPP dashboard configuration panel. as you can see in the given below image.

Upgrade PHP Version 7 to 8 in Xampp
Upgrade PHP Version 7 to 8 in Xampp

 

On the PHP-Module setup section, comment these two lines and add the two lines below

#
# PHP-Module setup
#
LoadFile “/xampp/php/php8ts.dll”
LoadFile “/xampp/php/libpq.dll”
LoadModule php_module “/xampp/php/php8apache2_4.dll”
LoadFile “C:/xampp/php/libsqlite3.dll”

That’s it. Now restart your XAMPP server and keep coding. Now you can check your php version via using the php_info() function or you can also use the command: php -v

Summary for Upgrade PHP Version 7 to 8 in Xampp

May in some cases you will face an error or issue. so, I recommend you restart your system once and check it again. if the error is still there or Xampp apache is not running so, you have 2 scenarios.

  1. Your PHP new version does not download or extracted correctly. or you have downloaded the wrong zip file.
  2. you did a mistake in the editing of httpd-xampp.conf file.

Also, Read Top Programming Languages and the Best way to earn online.

 

 8,125 total views,  1 views today

Leave a reply


This site uses Akismet to reduce spam. Learn how your comment data is processed.