If you are running WordPress or any PHP-based application locally on XAMPP, keeping your PHP version up to date is not just good practice — it is essential. Outdated PHP versions carry known security vulnerabilities, miss out on significant performance improvements, and can become incompatible with the latest versions of WordPress, plugins, and themes.
<cite index=”10-1″>XAMPP still ships with PHP 8.2 by default in 2026. If you want to take advantage of the performance and new features introduced in PHP 8.3 or PHP 8.4, you need to manually upgrade your PHP installation inside XAMPP.</cite>
The good news is that upgrading PHP in XAMPP does not require reinstalling the entire software stack. You can swap out the PHP version in under 10 minutes by replacing the PHP folder and updating a few lines in Apache’s configuration file — keeping all your existing projects, databases, and settings completely intact.
In this complete guide, we walk you through two proven methods for upgrading PHP in XAMPP on Windows — the recommended folder replacement method and the full XAMPP reinstall method — along with how to verify the upgrade worked, how to fix the most common errors, and answers to every common question about the process.
Why Upgrade PHP in XAMPP?
Before diving into the steps, here is why staying on a current PHP version matters:
Security: Older PHP versions stop receiving security patches after their end-of-life date. Running an outdated version on even a local development environment can expose vulnerabilities that affect your workflow and any code you eventually deploy to a live server.
WordPress compatibility: WordPress actively tests against and recommends specific PHP versions. As of 2026, WordPress recommends PHP 8.1 or higher and requires a minimum of PHP 7.4. Plugins and themes increasingly require PHP 8.0 or above.
Performance: <cite index=”10-1″>PHP 8.4 brings major improvements including faster performance via better JIT and memory handling, typed class constants for safer maintainable code, and readonly classes for stronger design consistency.</cite>
Error prevention: Testing your local WordPress site on the same PHP version your live hosting server uses ensures that what works locally will work in production — preventing unexpected errors after deployment.
Check Your Current PHP Version in XAMPP
Before upgrading, confirm which PHP version XAMPP is currently running.
Method 1 — Via XAMPP Control Panel:
- Open the XAMPP Control Panel
- Make sure Apache is running (green)
- Open your browser and go to http://localhost/dashboard
- The XAMPP dashboard shows the current PHP version in the components table
Method 2 — Via phpinfo():
- Navigate to C:\xampp\htdocs
- Create a new file called phpinfo.php using Notepad
- Add this single line:
<?php phpinfo(); ?> - Save the file and open http://localhost/phpinfo.php in your browser
- The PHP version is displayed prominently at the top of the page
Method 3 — Via XAMPP Shell:
- In the XAMPP Control Panel, click Shell
- Type
php -vand press Enter - The current PHP version is displayed in the output
Note down your current PHP version before proceeding — you will need it if you ever want to revert.
What PHP Version Should You Upgrade To?
In 2026, the recommended PHP versions are:
- PHP 8.4 — the latest stable release with the best performance and new language features. Recommended for new projects.
- PHP 8.3 — stable, well-tested, fully supported. A safe choice for projects requiring slightly more conservative compatibility.
- PHP 8.2 — still supported but approaching end of active development. Fine for existing projects but consider upgrading to 8.3 or 8.4.
- PHP 8.1 — security fixes only. Minimum recommended version for WordPress in 2026.
- PHP 7.x — end of life. No longer receives security updates. Avoid for any new or active project.
For WordPress development in 2026: PHP 8.2 or 8.3 offer the best balance of compatibility and performance. PHP 8.4 is excellent for new projects but may have some compatibility issues with older plugins.
Before You Start: Important Preparation Steps
Step A: Back Up Your Current PHP Folder
Always back up before making changes. This allows you to revert instantly if anything goes wrong.
- Navigate to C:\xampp
- Find the folder named php
- Right-click it and select Copy
- Paste it somewhere safe — your Desktop or a separate backup folder
- Rename the backup copy something clear like php_backup_8.2 so you know exactly what version it was
Step B: Back Up Your php.ini File
Your php.ini file contains all your PHP configuration settings — extension activations, memory limits, upload limits, and more. You will need to transfer key settings from your old php.ini to the new one.
- Navigate to C:\xampp\php
- Find the file named php.ini
- Copy it to the same backup folder
Step C: Stop Apache and MySQL
<cite index=”10-1″>Stop all running services in the XAMPP Control Panel before making any changes to the PHP folder.</cite>
- Open the XAMPP Control Panel
- Click Stop next to Apache
- Click Stop next to MySQL
- Confirm both services show as stopped (no longer highlighted in green)
Method 1: Upgrade PHP by Replacing the PHP Folder (Recommended)
This is the fastest and most widely used method. It replaces the PHP installation inside XAMPP without affecting any other XAMPP components.
Step 1: Download the New PHP Version
- Open your browser and go to windows.php.net/download
- Find the version you want to upgrade to (PHP 8.3 or 8.4 recommended)
- Critical: Download the correct build type:
- <cite index=”14-1″>Choose the Thread Safe (TS) variant — this is critical for Apache. Non-Thread Safe is for CGI/FastCGI, not for use with XAMPP.</cite>
- Choose x64 if your Windows PC is 64-bit (which almost all modern PCs are)
- The file will be a .zip file — for example, php-8.4.x-Win32-vs17-x64.zip
How to confirm 64-bit or 32-bit: Go to Windows Settings → System → About → look under Device Specifications → System type. It will say either “64-bit operating system” or “32-bit operating
system.”
Step 2: Install the Microsoft Visual C++ Redistributable (If Needed)
<cite index=”10-1″>Ensure Microsoft Visual C++ 2015–2022 Redistributable (x64) is installed — PHP 8.x on Windows requires it.</cite>
To check if it is already installed:
- Open Windows Settings → Apps (or Control Panel → Programs)
- Search for Microsoft Visual C++
- If you see Microsoft Visual C++ 2015-2022 Redistributable (x64), it is already installed
If it is not installed:
- Go to visualstudio.microsoft.com/downloads and scroll down to Other Tools, Frameworks, and Redistributables
- Download and install the Microsoft Visual C++ Redistributable for Visual Studio (x64 version)
- Run the installer and restart your PC if prompted
Step 3: Extract the New PHP Files
- Locate the downloaded PHP .zip file (e.g., in your Downloads folder)
- Right-click the .zip file → select Extract All
- Extract to a temporary location — for example, your Desktop or a folder called C:\php_new
- After extraction, you will have a folder containing all PHP files — php.exe, php.ini-production, php.ini-development, and many others
Step 4: Rename Your Existing XAMPP PHP Folder
<cite index=”10-1″>Although many tutorials suggest creating a new folder like php-8.4, XAMPP’s Apache configuration is hardcoded to use the existing folder name. Creating a different folder will cause Apache to fail at startup. Instead, replace the existing folder.</cite>
- Navigate to C:\xampp
- Find the php folder
- Right-click it → select Rename
- Rename it to php_old (or php_8.2_backup — whatever makes it clear)
Step 5: Copy the New PHP Folder into XAMPP
- Go back to where you extracted the new PHP files
- Select all the contents of the extracted PHP folder (press Ctrl + A)
- Create a new folder at C:\xampp and name it exactly php (lowercase, exactly as the original was named)
- Paste all the extracted PHP files directly into C:\xampp\php
Your C:\xampp\php folder should now contain the new PHP version files — including php.exe, php8apache2_4.dll (or similar), and php.ini-production.
Step 6: Configure the New php.ini File
The new PHP installation includes sample configuration files but no active php.ini. You need to create one and configure your essential extensions.
- Inside C:\xampp\php, find the file named php.ini-development
- Right-click it → Copy → Paste in the same folder
- Rename the copy to exactly php.ini
- Open php.ini with a text editor (right-click → Open with → Notepad, or use Notepad++)
Now enable the extensions that WordPress and web applications require. Find the following lines (they will have a semicolon ; at the beginning, which means they are commented out/disabled) and remove the semicolon to enable them:
extension=curl
extension=fileinfo
extension=gd
extension=intl
extension=mbstring
extension=mysqli
extension=openssl
extension=pdo_mysql
extension=zip
Also find the line for the extension directory and make sure it points correctly:
extension_dir = "C:/xampp/php/ext"
If the line is commented out (starts with ;), remove the semicolon.
Optional but recommended — enable OPcache for better performance:
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=192
opcache.interned_strings_buffer=16
Save the php.ini file when done.
Transfer any custom settings from your old php.ini: Open your backed-up php.ini file alongside the new one and manually copy across any custom values you had set — such as increased memory limits (memory_limit = 256M), larger upload sizes (upload_max_filesize = 64M), or custom error reporting settings.
Step 7: Update the Apache Configuration File
Apache needs to know which PHP module to load. After a major PHP version upgrade (for example, from PHP 8.2 to PHP 8.4), the module filename changes and the Apache configuration must be updated.
- Open the XAMPP Control Panel
- Next to Apache, click the Config button
- Select Apache (httpd-xampp.conf) from the dropdown — this opens the file in a text editor
- Search for lines referencing the PHP module — they will look something like this:
LoadFile "C:/xampp/php/php8ts.dll"
LoadModule php_module "C:/xampp/php/php8apache2_4.dll"
- Update these lines to match the exact filename of the PHP module in your new PHP folder. Open C:\xampp\php in File Explorer and look for a file named something like php8apache2_4.dll or php8apache2_4.dll — the filename may include the version number.
- Make sure the paths in the httpd-xampp.conf file match the exact filenames in your new C:\xampp\php folder.
- Save the httpd-xampp.conf file.
Step 8: Restart Apache and Verify the Upgrade
- Open the XAMPP Control Panel
- Click Start next to Apache
- Apache should start successfully (turns green)
- If Apache fails to start, see the troubleshooting section below
Verify the PHP version:
- Open your browser and go to http://localhost/phpinfo.php (the file you created earlier)
- The PHP version at the top of the page should now show the new version you installed
- If it still shows the old version, see the troubleshooting section
Method 2: Upgrade by Reinstalling XAMPP (Cleanest Method)
If you are not comfortable manually editing configuration files, or if Method 1 causes persistent errors, the cleanest approach is to reinstall XAMPP with the latest version — which ships with a newer PHP version than your current installation.
Step 1: Back Up Your Data
Before uninstalling, back up everything you want to keep:
- Copy your entire C:\xampp\htdocs folder to a safe location — this contains all your local websites
- Export all your databases from phpMyAdmin (go to each database → Export → Go → save the .sql files)
- Copy your C:\xampp\php\php.ini file to save your custom settings
Step 2: Uninstall XAMPP
- Open Windows Settings → Apps
- Search for XAMPP and click Uninstall
- Follow the uninstaller prompts — choose to remove all XAMPP files when asked
- Delete the C:\xampp folder manually if it remains after the uninstaller completes
Step 3: Download and Install the Latest XAMPP
- Go to apachefriends.org and download the latest XAMPP version for Windows
- The latest XAMPP version ships with the most recent PHP release available at time of packaging
- Run the installer and follow the same steps covered in the previous WordPress XAMPP installation guide
- Install to C:\xampp as before
Step 4: Restore Your Data
- Copy your backed-up htdocs folders back into C:\xampp\htdocs
- Import your database backups through phpMyAdmin (go to the database → Import → select your .sql file)
- Transfer any custom php.ini settings to the new installation’s php.ini file
How to Verify the PHP Upgrade Was Successful
After restarting Apache, confirm the upgrade completed correctly using these three checks:
Check 1 — phpinfo() page: Open http://localhost/phpinfo.php — the PHP version shown at the top should match the version you installed.
Check 2 — XAMPP Shell: Open the XAMPP Control Panel → click Shell → type php -v → press Enter. The output should show the new PHP version number.
Check 3 — WordPress site check: If you have a local WordPress site, log into the dashboard → go to Tools → Site Health → Info → Server section. WordPress will display the current PHP version your server is running.
Troubleshooting Common Errors
Apache will not start after upgrading PHP
This is the most common issue and is almost always caused by one of these:
- Wrong PHP build downloaded: Confirm you downloaded the Thread Safe (TS) version, not Non-Thread Safe (NTS)
- Wrong architecture: Confirm you downloaded x64 if your Windows is 64-bit
- httpd-xampp.conf not updated: Confirm the PHP module filenames in httpd-xampp.conf match the actual files in your new C:\xampp\php folder
- Missing Visual C++ Redistributable: Install the Microsoft Visual C++ 2015–2022 Redistributable (x64)
To diagnose the exact error: In the XAMPP Control Panel, click Shell → type apache_start → press Enter. The shell will show the detailed error message that the control panel’s pop-up hides.
phpinfo() still shows the old PHP version
This means Apache is not loading the new PHP module correctly.
Fix:
- Stop Apache in the XAMPP Control Panel
- Confirm the C:\xampp\php folder contains the new PHP files (not the old ones)
- Open httpd-xampp.conf via XAMPP Control Panel → Apache Config
- Verify the LoadModule line points to the correct DLL filename in the new php folder
- Save, restart Apache, and check phpinfo() again
WordPress showing PHP compatibility warnings
Some older plugins or themes may show compatibility warnings after upgrading to PHP 8.3 or 8.4. This is because they were written for older PHP versions and use functions or syntax that has been deprecated or removed.
Fix options:
- Update the plugin or theme to its latest version — most reputable plugins are already PHP 8.x compatible
- If the plugin has not been updated and the issue is critical, temporarily test on PHP 8.2 by swapping back to your backed-up php folder
- Report the compatibility issue to the plugin developer
Extensions not loading (curl, gd, mbstring errors)
This means the extensions are not enabled in your new php.ini file.
Fix: Open C:\xampp\php\php.ini → search for the extension name → remove the semicolon at the beginning of the line to enable it → save → restart Apache.
“The specified module could not be found” error
This error typically means a required DLL file is missing or the wrong version was downloaded.
Fix: Confirm you downloaded the correct Thread Safe x64 version of PHP. Also confirm the Microsoft Visual C++ 2015–2022 Redistributable is installed. Try redownloading the PHP package and replacing the files again.
Best Practices When Upgrading PHP in XAMPP
Always back up before upgrading. Rename your existing php folder rather than deleting it — this gives you an instant rollback path if anything goes wrong.
Match your local PHP version to your live server. Check your hosting control panel to see which PHP version your live website runs on. Setting your local XAMPP to the same version ensures that code working locally will work in production.
Test your WordPress site immediately after upgrading. After restarting Apache, open your local WordPress site and check the frontend and admin dashboard for any errors or warnings. Go to Tools → Site Health for a health check report.
Update all plugins and themes before upgrading PHP. Outdated plugins are the most common source of PHP compatibility errors. Update everything in your WordPress dashboard before changing PHP versions to minimise potential conflicts.
Keep your backup php folder for at least a week. Do not delete your renamed php_old folder until you are confident the new version is working correctly for all your projects.
Frequently Asked Questions
How do I check my PHP version in XAMPP?
Open XAMPP Control Panel → click Shell → type php -v → press Enter. Alternatively, create a file in htdocs called phpinfo.php containing <?php phpinfo(); ?> and open http://localhost/phpinfo.php in your browser.
Do I need to reinstall WordPress after upgrading PHP in XAMPP?
No. Your WordPress files, database, and all content remain completely untouched. Upgrading PHP only affects how your local server processes PHP code — not the WordPress files themselves.
What is the difference between Thread Safe and Non-Thread Safe PHP?
<cite index=”14-1″>Thread Safe is critical for Apache. Non-Thread Safe is for CGI/FastCGI environments.</cite> Since XAMPP uses Apache, always download the Thread Safe version when upgrading PHP for XAMPP.
Can I have multiple PHP versions in XAMPP?
Not natively within a single XAMPP installation — XAMPP uses one PHP version at a time. You can switch between versions by swapping the php folder contents, but you cannot run two versions simultaneously without additional configuration. For multi-version PHP management, consider using LocalWP or Laragon instead.
Will upgrading PHP in XAMPP affect my live website?
No. XAMPP runs entirely on your local computer and has no connection to your live hosting server. Upgrading PHP in XAMPP only affects your local development environment.
Which PHP version should I use for WordPress in 2026?
WordPress recommends PHP 8.1 or higher. PHP 8.2 and 8.3 offer the best combination of compatibility and performance for WordPress development in 2026. PHP 8.4 is the latest stable release but may have minor compatibility issues with some older plugins.
What should I do if a plugin breaks after upgrading PHP?
First, update the plugin to its latest version — most modern plugins are PHP 8.x compatible. If the latest version still has issues, check the plugin’s support page for known PHP 8.x compatibility problems. As a temporary measure, you can revert to your backed-up PHP folder while you find a solution.
How long does it take to upgrade PHP in XAMPP?
The entire process — downloading, replacing files, updating configuration, and verifying — typically takes less than 10 minutes.

