• First and foremost, let check your PHP version in your local machine (Assumption that we are using Windows).
php -v
• The next step, run php --ini to check php.ini location:
php --ini
Example output:
php -v
PHP 8.0.6 (cli) (built: May 4 2021 23:31:45) ( ZTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.6, Copyright (c) Zend Technologies
php --ini
Configuration File (php.ini) Path:
Loaded Configuration File: C:\xampp\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
• Assume that we want to upgrade the PHP version for XAMPP. Let's attempt to download a specific version from here: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/7.3.30/.
• Change the Apache and PHP folders by adding '.old' to create backups that can be rolled back to the old version in XAMPP.
• After that, copy the Apache and PHP folders from the upgraded XAMPP to the old location of XAMPP on the local machine.
• Use Ctrl + F to search for '\xampp' in php.ini and make changes to the following lines.
include_path = C:\xampp\php\PEAR
extension_dir = "C:\xampp\php\ext"
```"