ποΈ Step 1: Locate Your XAMPP Folder
Navigate to the directory where XAMPP is installed (usually C:\xampp).
Rename the existing apache and php folders to keep them as backups. For example:
phpβphp-8.2.XXapacheβapache-8.2.XX
This helps you identify which version you're currently using and allows easy rollback if needed.
β¬οΈ Step 2: Download the Desired XAMPP Version
- Go to XAMPP SourceForge Downloads.
- Choose the version you want (make sure to select the ZIP version for Windows).
- You can choose either the regular (For PC) or portable version.
- Download and extract the ZIP file on your computer.
π Step 3: Stop All XAMPP Services
Before making the switch:
- Open the XAMPP Control Panel.
- Stop Apache and MySQL (or any other running services).
This ensures no processes are using the old version.
π Step 4: Copy Apache and PHP Folders
After extracting the ZIP:
- Open the extracted folder.
- Copy the
apacheandphpfolders. - Paste them into your existing
C:\xampp\directory.
You should now have your new php and apache folders ready to go.
π οΈ Step 5: Update php.ini Paths
- Go to the newly copied
phpfolder: - Open
php.iniin a text editor. - Search for any paths starting with
xampp\and change them to match your actual path (e.g.,C:\xampp\).
example
Update all relevant paths to avoid loading issues.
βΆοΈ Step 6: Start Apache and PHP
Now that your new PHP version is in place:
- Start Apache from the XAMPP Control Panel.
- Youβre all set!
To verify visit http://localhost/phpinfo.php in your browser to confirm the new PHP version is active.
π Step 7: How to Switch Back to a Previous PHP Version in XAMPP
Need to go back to your previous setup? It's easy if you've renamed and preserved your old php and apache folders.
πͺ Step-by-Step Rollback
- Stop all running services in the XAMPP Control Panel (Apache, MySQL, etc.).
- Go to your XAMPP directory (e.g.,
C:\xampp). - Rename the current folders to reflect their version:
phpβphp-7.4.XXapacheβapache-7.4.XX- Rename your previous version folders back to active:
php-8.2.XXβphpapache-8.2.XXβapache- Double-check your
php.iniin the restoredphpfolder to make sure all paths are correct (e.g.,C:\xampp\php\ext, etc.).
Comments
If you run into any issues while switching PHP versions in XAMPP, feel free to drop your questions below! Also, let me know what version you're upgrading or downgrading to β Iβd love to help troubleshoot or update this guide based on your feedback.
Leave a Comment