Many web developers, especially beginners, have a common question “How to update PHP version in XAMPP?”. After getting a lot of queries on the topic, we decided to write a short and simple tutorial on how you can easily update PHP version in Windows XAMPP.
XAMPP plays a significant role for web developers and it’s one of the most popular stacks that developers use to build and test websites locally. What makes it popular among developers is that even if something goes wrong with the code, it doesn’t affect the live web platform.
Working on the localhost is indeed a good practice to boost your web development skills and it is also common among WordPress developers. However, most users are left asking “How to change PHP version in XAMPP?” Or “How to upgrade PHP version in XAMPP?”.
In this tutorial, I will show you how easily you can update your PHP version in XAMPP through 4 simple steps. However, before embarking on the process you need to know why it is important to upgrade PHP version on XAMPP and when is the right time to change the PHP version.
The PHP version requirements often vary with specifications of the project you are working on. Sometimes it’s the users who demand a newer PHP version which can compel you to update it. In most cases, whenever a new PHP version is rolled out, users and developers waste no time in updating their current versions to avoid security threats.
As a member of various developers’ community, I often see many developers still using the older version of XAMPP(i.e. XAMPP 3.2.1 or older) that runs on PHP 5. What they are mostly concerned with is updating the PHP version in their current XAMPP without reinstalling it all together.
PHP 7 offers an advanced set of functionalities as compared to PHP 5, which are all reasons why you should update your PHP version as soon as it is launched. To check the PHP version, type http://localhost/phpinfo.php in your browser and a new screen will appear with the PHP version information.
Let’s look at why PHP 7 has the upper hand over PHP 5.
Now that we have understood how important it is to update your PHP version in XAMPP, let’s move forward and see how you can update your PHP version in 4 simple steps.
The beauty of the XAMPP lies in the fact that it’s a development server, not a production server. This means that you can play with its configuration and make simple changes like changing its PHP version without affecting your live application.
Note: I would recommend that before you upgrade PHP version in XAMPP, make a backup for your site files or project files. ALWAYS MAKE A BACKUP FOR DATA.
Updating PHP version in XAMPP is simple. All you need to do is follow these 4 simple steps.
First, you need to click here to download the latest binary version of PHP. Make sure you download the Thread Safe Zip file depending upon your Windows version( x86 for 32-bit and x64 for 64-bit ), as you can see in the image below.
In the above image, you can see that I have downloaded the VC14x64 Thread Safe because my windows version is 64-bit.
Next, create a new folder in your Windows desktop and name it PHP. Then, extract the Zip file into that new folder(i.e. PHP).
Next, go to XAMPP folder and select the php folder and rename it with something like php_5 and then paste the extracted-new-php folder on XAMPP directory. You can see in the below image, how I did this.
Next in the process is to configure the Apache server and for this, you need to open your XAMPP control panel then click on Apache Config > Apache (httpd-xampp.conf).
Then, an httpd-xampp.config file will open on your screen. Next, in the PHP-Module setup, paste the new lines of code and remove the previous lines of code like as shown in the below image.
Previous lines of code:
LoadFile “D:/xampp/php/php5ts.dll” LoadFile "D:/xampp/php/libpq.dll" LoadModule php5_module “D:/xampp/php/php5apache2_4.dll”
New lines of code:
LoadFile "D:/xampp/php/php7ts.dll" LoadFile "D:/xampp/php/libpq.dll" LoadModule php7_module "D:/xampp/php/php7apache2_4.dll"
Then, save the file and restart the XAMPP server. Tada! It’s done.
I hope this tutorial helped you to learn “How to update PHP version in XAMPP”. If you need any support or if you face any problem while updating XAMPP PHP version don’t hesitate to ping me in the comments section or email me at email@example.com, I would love to help you out!
Gutenberg just released its second update of 2020 on 22 January and with the help of 159 contributions from 56…
Customers don’t care about how much information you have on your website until you have an attractive layout that keeps…
When it comes to running your business, one of the most important commodities you have is time. Many of you…
In the early 2000s, Amazon stepped into the limelight as an online bookseller. Fast forward two decades, and it’s the…