While working on web development projects, sometimes we need to change PHP versions. For example, when you are working on a Laravel project and need to update to the latest version, you may need to update the PHP version first. Or sometimes, you may need to downgrade the PHP versions when working on the legacy project.
In this article, we will discuss how we can change the PHP version in Xampp in simple steps. This is a simple process and 100% working.
Download Xampp Source code version from https://sourceforge.net/. If you want to upgrade the PHP version, you can choose the latest one. After download, extract the file.
Note: Please download the zipped(.zip) version NOT the installer (.exe) version
Now go to your currently installed Xampp directory and rename the
Apache folder and
php folder. You can rename it to anything other than the default name.
Note: I suggest not to delete these folders because we can change the PHP version to current one in future. And renaming and keeping the files won't affect our code.
Go to the new extracted folder and copy ONLY
php folder. After copy, paste it in the current Xampp directory ex: C:\xampp or D:\xampp
Next step is to set up the directory path in the
php.ini file. Change the following directory path.
The final step is to restart the Xampp server. After the successful restart, you will be able to see the latest change in PHP version in your Xampp server.