Updating PHP version with XAMPP

Here is how to easily and successfully upgrade PHP version in XAMPP for windows. It can be done with any XAMPP PHP version of your choice. I upgraded to PHP 7.3.1 from the old 5.6 successuly this way.

xampp logo

Backup current XAMPP

Make sure XAMPP is turned off.

First you need to make spare copies and backups of a few folders and files. If you have enough space just do a whole copy of the XAMPP directory (C:\xampp) this is recommended otherwise copy these to a safe place:

  1. C:\xampp\htdocs
  2. C:\xampp\mysql\data
  3. C:\xampp\php\php.ini

And any other configuration files you have altered, if you havent changed the php.ini there is no need to copy. Also this is assuming you’re using htdocs folder as the document root for the web server.

Download the PHP version

Download the version of PHP packed in XAMPP from here for Windows PHP 7.3.1 go here and download the portable zip file.

Apply the new PHP version

Open the downloaded portable XAMPP and drag the contents into C:\xampp overwriting the original files. Once that’s finished drag back in and overwrite:

  1. C:\xampp\htdocs
  2. C:\xampp\mysql\data
  3. C:\xampp\php\php.ini

Or any other files you need from your previous installation.

Start up XAMPP and you will now have a fresh PHP version.