Sometimes we install a new version of xampp and it came with a PHP version that doesn’t work with the application we want to run on it, to modify it is a pain and certainly not easy for new developers. What happens usually is we have already imported db, in my case, it was a 20 GB + database which took about 6 hours to import. Now I can’t just uninstall this xampp and download and install a new one as this would mean to go through the DB import process again.
Easiest way to solve this is search on google a zip of xampp which does contain the PHP version you are looking for.
In case of windows, search for the zip if not possible then download .exe for it.
If you have download zip file, simply extract it using any unzip tool and copy the php folder on the root of XAMPP directory. Then go to your installation of XAMPP and overwrite the PHP folder. It works like a charm.
In case you are using Windows and have download .exe installer, then go ahead and complete the installation, make sure you don’t overwrite the old installation, instead set a different path of new xampp. Like C:\xampp2
After installing is complete, go to new installation folder and copy the php folder. Then paste that folder inside old xampp installation and overwrite the php folder it contains.
You have successfully changed the PHP version of your xampp installation!