How to Update Change PHP Version in XAMPP
While using XAMPP for web development, there can be a point when you may require to update or change PHP version or say MySQL version in order to obtain some specific result. In this tutorial for beginners, I will show you how to change PHP version in XAMPP that too without reinstalling XAMPP.
To update the PHP version in XAMPP, you don’t have to reinstall XAMPP. Rather you can change PHP version by following a few simple steps explained below. And this approach saves you a lot of time and effort you may have consumed in reinstalling XAMPP. And those who still struggling about how to install XAMPP would surely find this article helpful. The PHP version requirement varies with the project specifications. You may need to employ a different version of PHP in XAMPP for one of your particular project.
Now I will show you how quickly you can check PHP version in XAMPP. Also, how to update PHP version in XAMPP and change PHP version XAMPP. Let’s get started !!
How to Change PHP Version XAMPP
As we know XAMPP is an open source solution that serves as a local web server to develop and test PHP projects. And every project has its own requirement of PHP as well as MySQL version and you are bound to set up the required versions so as to get the desired results. The latest version of PHP 7 has come up with incredible features and compatibility. If you are planning to reinstall XAMPP (thinking to make it compatible with the latest or the previous version of PHP) then you should have the clarity of method. And the process of reinstalling XAMPP comprises the following:
- phpMyAdmin back up
- Copying htdocs files
- Copy the php.ini file content (required ones)
- Take back up of the entire XAMPP folder in a new folder.
- Delete older XAMPP (after back up)
Be extremely careful while backing up required data and deleting older XAMPP in order to install the new one.
Certainly, you won’t prefer to get caught up in this intricate situation where you’re likely to lose data. And the chances of losing data are greater if you make any mistake. Hence, no room for negligence and unprepared actions.
However, this makes sense to omit this crucial sitch by opting the other feasible solution that will help you update PHP version XAMPP in a few simple steps.
Steps to Update PHP Version in XAMPP
Step 1: First off download the needed version of PHP from https://windows.php.net/download#php-7.0 and unzip the folder and name it. Make sure you don’t name it something confusing with simple PHP. And now extract the content of the zip file.
Step 2: If there’s any custom configuration in the php.ini file, then you need to copy and replace the entire content with the new one. However, if you haven’t made any changes to this file then you can skip this step.
Step 3: Now, open the XAMPP server. And click on the ‘Config’ button in the Action column parallel to Apache. Now you can see the configuration files of Apache, open the “httpd-xampp.config” from here.
Step 4: Go to PHP-Module section, and comment the following lines of code and add the new two lines instead.
# # PHP-Module setup # #LoadFile “C:/xampp/php/php5ts.dll” #LoadModule php5_module “C:/xampp/php/php5apache2_4.dll” LoadFile “C:/xampp/php/php7ts.dll” LoadModule php7_module “C:/xampp/php/php7apache2_4.dll”
That’s all. Simply restart the XAMPP and you’re good to go.
Now, you are ready to Change PHP Version in XAMPP
So this is how you can check PHP version in XAMPP and also update PHP version in XAMPP hassle-free. Since PHP is the foundation of any project so you need to keep it updated all the time. And XAMPP, on the other hand, it yields you the platform to test your project with ease. In case you have an old installation of XAMPP that is messed up with lots of file, you may refer to this article in order to completely update XAMPP. If you are a beginner, then the chances of getting stuck in the web development process are higher. Whereas, using a website builder can help you achieve that in no time. And if you’re using TemplateToaster website builder then you don’t have to bother about anything. It is one of the strongest website builders present in the market. Try it to believe it!! And don’t forget to share your experience with me in the comments below. Also, if you need any support or face any issues, while XAMPP change PHP version, then do let me know.