How to Upgrade PHP Version on XAMPP


The method here so that if anyone needs to use PHP 8.3 quickly, you can try updating XAMPP by manually replacing the PHP version with a newer one:

Backup The Important Files

Before making any changes, it's always a good idea to backup your important files and databases to avoid data loss.

Stop XAMPP Services

Make sure XAMPP is not running. You can stop the Apache and MySQL services from the XAMPP Control Panel.

Rename Existing PHP Folder

Go to the XAMPP installation directory and navigate to the php folder. Rename the existing php folder to something like php_backup.

Downlod PHP

Visit the official PHP website (https://windows.php.net/download#php-8.3) and download the Windows version of PHP 8.3.4 (Current).

Xampp using Thread Safe version so we have to download VS16 x64 Thread Safe (2024-Mar-13 12:02:32)

You can download from the following link:

https://windows.php.net/downloads/releases/php-8.3.4-Win32-vs16-x64.zip

Copy the PHP Folder 

Then, copy the contents of the PHP 8.3.4 folder that you downloaded into the XAMPP php folder.

Create "windowsXamppPhp" Folder

Create new folder inside php folder and name it "windowsXamppPhp" for example you have c:\xampp\php\windowsXamppPhp path and copy again the contents of the PHP 8.3.4 into the windowsXamppPhp folder too (I do not know why! But xampp does it so I did just to make sure).

Copy Other Folder from php_backup Folder

Also copy other folders and files from php_backup to the php folder which were now missing in the downloaded php 8.3.4, which are:

cfg

CompatInfo

data

docs

man

pear

scripts

tests

tmp

www

CompatInfo.php

webdriver-test-example.php

Edit php.ini File

Now we need php.ini file!

Duplicate "php.ini-development" in php root folder and rename it "php.ini"

Personally, I used the online comparison tool to make the PHP configuration the same as XAMPP, so that I could compare the new php.ini file with the old one in php_backup faster and better and make sure you enabled desire php extension such as mysqli, gd, pdo_mysql, pdo_sqlite ...

Start The Apache Services

Now you can start the Apache and MySQL services from the XAMPP Control Panel.

Check http://localhost/dashboard/phpinfo.php


Post a Comment

Previous Post Next Post