Download PHP from the latest Xampp:Extract the folder and copy php folder from the latest xampp. Now, go to your existing xampp folder and rename the current PHP folder to php7 or whatever you want. Then paste the new php folder in the existing xampp. That's it!
Take a backup of your htdocs and data folder (subfolder of MySQL folder), reinstall upgraded version and replace those folders.
Note: In case you have changed config files like PHP (php.ini), Apache (httpd.conf) or any other, please take back up of those files as well and replace them with newly installed version.
You can go through the following link as it helped me, should work for you as well. http://hype-free.blogspot.com/2007/07/updating-php-in-xampp-for-windows.html
Realizing that my answer helped couple of users, here is the edit from original link:
Edit:
NOTE: there are two directories to be updated with new version of files, namely php
sub-directory and apache/bin
sub-directory, inside XAMPP installation.
Simplest method to upgrade PHP
in XAMPP
:
XAMPP
.XAMPP
already installed).PHP
folder from the extracted archive.PHP
folder which is in installed XAMPP
directory. You can backup it like changing the PHP
folder name to PHP-old
or
like PHP-version-number
PHP
folder which you copied from the extracted archive.php.ini
file with your backup folder php.ini
file in case you have changed the default settings earlier.server
.I needed to update my php from 5.3.8 to 5.3.29. (both Thread Safe) on Windows
Steps I did:
Hope that I covered everything.
Most probably these steps will not work if you change major versions of php, e.g. 5.3.x to 5.4.x, but for minor versions, it should work.
Also, a good way to see what's wrong... start command line and try to start httpd.exe, under xampp/apache/bin from there, it will list errors found.
I have upgraded to php7.2 from php5.6
Steps which I followed.
C:\xampp\apache\conf\extra\http-xampp.conf
5.1. Replace
LoadFile "C:/xampp/php/php5ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
to
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
I think you need to actually download and install XAMPP with the desired PHP version. I dont think you can just upgrade the components of XAMPP individually unless there is a facility provided for this within XAMPP itself.
download your desired version of php binary from http://windows.php.net/download/ website. download Thread Safe binary zip version. Unzip the downloaded version of the PHP in a separate folder. Please make sure that your new php folder name is not "PHP". May be you can use filder name as the version name. For example for php 5.4 you can use php54.
Copy the new php folder into your xampp folder. Now go to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. Change the following variables:
Variable PHPINIDir to be / Varaible LoadModule to be //php5apache2_2.dl
Save the file httpd-xampp.conf. Restart your XAMPP apache server. If your server get restarted successfully then your server php version is upgraded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With