4 Steps to Downgrade PHP in XAMPP Easily

SHARES

When developing a website, knowing how to downgrade PHP in XAMPP can be a solution if you encounter compatibility issues with applications or frameworks that don’t yet support the latest PHP version.

For example, if you’re developing a WordPress site with an older PHP version that still requires specific functions, a downgrade can ensure your plugins and themes continue to work correctly.

In this tutorial, we’ll demonstrate how to downgrade PHP from version 8 to 7 in XAMPP. You can adapt this method for downgrading other PHP versions as well.

How to Downgrade PHP in XAMPP: Case Study from PHP Version 8 to PHP 7

Downgrading your PHP version involves several steps. We’ve organized these stages to ensure your PHP version downgrade process goes smoothly.

This method for downgrading PHP in XAMPP starts with (1) checking your PHP version, (2) performing a backup, (3) downloading the required PHP version, and (4) starting the downgrade.

Step 1: Check Your PHP Version in XAMPP

This simulation is performed with XAMPP installed on Windows. Here’s how to check your PHP version in XAMPP on Windows:

  1. Open the XAMPP Control Panel > activate the Apache and MySQL modules.
    XAMPP Control Panel with Apache and MySQL active
  2. Open your browser > type localhost in the URL bar > open the PHPInfo tab.
    Browser showing localhost and PHPInfo tab
  3. Your PHP version will be displayed.
    PHP Version displayed in PHPInfo

Step 2: Perform a Backup

It’s crucial to perform a backup before downgrading your PHP version. This ensures that your Content Management System (CMS) or any other type of website you are developing remains safe. Here’s how to perform a backup:

  1. Open the XAMPP folder on your local computer.
    XAMPP folder on local computer
  2. Rename the apache folder to something else. For example, here it’s renamed to apache_backup.
    Renaming apache folder to apache_backup
  3. Rename the php folder to something else. For example, here it’s renamed to php_backup.
  4. Save the changes, and you’re done. You’ve successfully created a backup.

Step 3: Download the Required PHP Version

You can actually download PHP versions separately here (versions 3 to 8). However, it’s easier to download the XAMPP file that corresponds to your needs, as the configuration process is simpler. Here’s how:

  1. Visit the XAMPP website and download an XAMPP version older than your current one.how to downgrade php version in xampp– For Windows users, you can download it here.
    – For Linux users, you can download it here.
    Ensure you download the version corresponding to your Operating System. Downloading XAMPP for Windows 7.1.32 x64
  2. In this example, we are using XAMPP for Windows version 7.1.32 (x64).
  3. Download that XAMPP file.
    how to downgrade php version in xampp
  4. Once the download is successful, it’s time to downgrade PHP.

Step 4: Perform the PHP Downgrade in XAMPP

In short, downgrading PHP involves moving the apache and php folders from the older XAMPP version (that you just downloaded) into the XAMPP folder currently installed on your local computer. Here’s how:

  1. Extract the XAMPP file you previously downloaded.
    Extracting the downloaded XAMPP file
  2. Open the extracted folder > copy the apache and php folders.
    Copying apache and php folders from extracted XAMPP
  3. Go to the XAMPP folder already installed on your local computer > paste the copied apache and php folders there. Pasting apache and php folders into the installed XAMPP directory
  4. Once the file transfer is complete, reopen the XAMPP Control Panel.
    how to downgrade php version in xampp
  5. Then, start the Apache and MySQL modules.
  6. Open your browser and type localhost in the URL field.
    how to downgrade php version in xampp
  7. The PHP version has now been successfully changed.

Successfully Downgraded PHP in XAMPP?

That’s how you downgrade PHP in XAMPP for Windows users. Easy, right? If you’ve installed XAMPP on Linux and need a tutorial for it, feel free to send us a message!

This tutorial isn’t just for those who install WordPress on localhost, but also for anyone developing PHP-based websites using XAMPP as their web server.

If you require further website development services, you can discuss your needs with the Tonjoo Team, a web development consultancy that has been handling websites since 2013. Contact us, and let’s collaborate!

company profile website example


Read similar articles by Moch. Nasikhun Amin on the Tonjoo blog about WordPress, WooCommerce, plugins, and other web development topics.


 

Updated on June 22, 2025 by Moch. Nasikhun Amin

Lets Work Together!

Create your ideal website with us.