Close Menu
Mokube techMokube tech
  • Home
  • SmartPhones
  • News
  • Latest Reviews
  • How to
  • Contact Us
  • OUR SERVICES
Facebook X (Twitter) Instagram YouTube TikTok
Monday, September 14
Trending
  • Vivo T5 5G Key Specs Revealed: Battery, Camera Confirmed
  • How to Import Amazon Products to WordPress WooCommerce in Bulk (Complete Guide)
  • How to Set Up WooCommerce in WordPress (Complete Beginner’s Guide)
  • JBL Tune Flex 2 Review: Is This the Best Mid-Range True Wireless Earbud
  • How to Make a Transparent Background in Adobe XD (Complete Guide)
  • Huawei Mate XT 2 Ultimate Design Official First Look Revealed Ahead of September 7 Launch
  • How to Stop Auto Download in WhatsApp (Step-by-Step Guide)
  • Honor Turbo 5G Debuts With 8,560mAh Battery, Snapdragon 6 Gen 4
Mokube techMokube tech
  • Home
  • SmartPhones
  • News
  • Latest Reviews
  • How to
  • Contact Us
  • OUR SERVICES
Facebook X (Twitter) Instagram
  • Camera News
  • MacBook
  • Samsung
  • Apple
  • Google
  • Xiaomi
  • Nothing
  • Sony
  • Telegram tips
  • Canva Tips
  • AI Tools
  • Whatsapp Tips
Mokube techMokube tech
  • Camera News
  • MacBook
  • Samsung
  • Apple
  • Google
  • Xiaomi
  • Nothing
  • Sony
  • Telegram tips
  • Canva Tips
  • AI Tools
  • Whatsapp Tips
Home » How to Upgrade PHP Version in XAMPP (Step-by-Step Guide)
How to Onoyri MokubeBy Onoyri Mokube

How to Upgrade PHP Version in XAMPP (Step-by-Step Guide)

Onoyri MokubeBy Onoyri MokubeAugust 2, 2026Updated:August 3, 2026
Facebook Twitter Pinterest LinkedIn Tumblr WhatsApp VKontakte Email
how to upgrade PHP version in XAMPP
Share
Facebook Twitter LinkedIn Pinterest Email

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:

  1. Open the XAMPP Control Panel
  2. Make sure Apache is running (green)
  3. Open your browser and go to http://localhost/dashboard
  4. The XAMPP dashboard shows the current PHP version in the components table

Method 2 — Via phpinfo():


  1. Navigate to C:\xampp\htdocs
  2. Create a new file called phpinfo.php using Notepad
  3. Add this single line: <?php phpinfo(); ?>
  4. Save the file and open http://localhost/phpinfo.php in your browser
  5. The PHP version is displayed prominently at the top of the page

Method 3 — Via XAMPP Shell:

  1. In the XAMPP Control Panel, click Shell
  2. Type php -v and press Enter
  3. 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.

  1. Navigate to C:\xampp
  2. Find the folder named php
  3. Right-click it and select Copy
  4. Paste it somewhere safe — your Desktop or a separate backup folder
  5. 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.

  1. Navigate to C:\xampp\php
  2. Find the file named php.ini
  3. 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>

  1. Open the XAMPP Control Panel
  2. Click Stop next to Apache
  3. Click Stop next to MySQL
  4. 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

  1. Open your browser and go to windows.php.net/download
  2. Find the version you want to upgrade to (PHP 8.3 or 8.4 recommended)
  3. 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:

  1. Open Windows Settings → Apps (or Control Panel → Programs)
  2. Search for Microsoft Visual C++
  3. If you see Microsoft Visual C++ 2015-2022 Redistributable (x64), it is already installed




If it is not installed:

  1. Go to visualstudio.microsoft.com/downloads and scroll down to Other Tools, Frameworks, and Redistributables
  2. Download and install the Microsoft Visual C++ Redistributable for Visual Studio (x64 version)
  3. Run the installer and restart your PC if prompted

Step 3: Extract the New PHP Files

  1. Locate the downloaded PHP .zip file (e.g., in your Downloads folder)
  2. Right-click the .zip file → select Extract All
  3. Extract to a temporary location — for example, your Desktop or a folder called C:\php_new
  4. 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>

  1. Navigate to C:\xampp
  2. Find the php folder
  3. Right-click it → select Rename
  4. Rename it to php_old (or php_8.2_backup — whatever makes it clear)

Step 5: Copy the New PHP Folder into XAMPP

  1. Go back to where you extracted the new PHP files
  2. Select all the contents of the extracted PHP folder (press Ctrl + A)
  3. Create a new folder at C:\xampp and name it exactly php (lowercase, exactly as the original was named)
  4. 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.

  1. Inside C:\xampp\php, find the file named php.ini-development
  2. Right-click it → Copy → Paste in the same folder
  3. Rename the copy to exactly php.ini
  4. 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.

  1. Open the XAMPP Control Panel
  2. Next to Apache, click the Config button
  3. Select Apache (httpd-xampp.conf) from the dropdown — this opens the file in a text editor
  4. 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"
  1. 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.
  2. Make sure the paths in the httpd-xampp.conf file match the exact filenames in your new C:\xampp\php folder.
  3. Save the httpd-xampp.conf file.


Step 8: Restart Apache and Verify the Upgrade

  1. Open the XAMPP Control Panel
  2. Click Start next to Apache
  3. Apache should start successfully (turns green)
  4. If Apache fails to start, see the troubleshooting section below

Verify the PHP version:


  1. Open your browser and go to http://localhost/phpinfo.php (the file you created earlier)
  2. The PHP version at the top of the page should now show the new version you installed
  3. 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:

  1. Copy your entire C:\xampp\htdocs folder to a safe location — this contains all your local websites
  2. Export all your databases from phpMyAdmin (go to each database → Export → Go → save the .sql files)
  3. Copy your C:\xampp\php\php.ini file to save your custom settings


Step 2: Uninstall XAMPP

  1. Open Windows Settings → Apps
  2. Search for XAMPP and click Uninstall
  3. Follow the uninstaller prompts — choose to remove all XAMPP files when asked
  4. Delete the C:\xampp folder manually if it remains after the uninstaller completes

Step 3: Download and Install the Latest XAMPP

  1. Go to apachefriends.org and download the latest XAMPP version for Windows
  2. The latest XAMPP version ships with the most recent PHP release available at time of packaging
  3. Run the installer and follow the same steps covered in the previous WordPress XAMPP installation guide
  4. Install to C:\xampp as before


Step 4: Restore Your Data

  1. Copy your backed-up htdocs folders back into C:\xampp\htdocs
  2. Import your database backups through phpMyAdmin (go to the database → Import → select your .sql file)
  3. 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:

  1. Stop Apache in the XAMPP Control Panel
  2. Confirm the C:\xampp\php folder contains the new PHP files (not the old ones)
  3. Open httpd-xampp.conf via XAMPP Control Panel → Apache Config
  4. Verify the LoadModule line points to the correct DLL filename in the new php folder
  5. 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.

Share. Facebook Twitter Pinterest LinkedIn Tumblr WhatsApp Email
Previous ArticleOnePlus N6X: A Solid Budget Pick at ₹17,499, But Grab It Before the Price Hike
Next Article Samsung Galaxy S27: Latest Leaks Reveal Display, Camera, and Software Details
Onoyri Mokube
  • Website
  • Facebook
  • X (Twitter)
  • Pinterest
  • Instagram

Onoyri Mokube Eseokwea is a software engineer, content creator, and the founder of MokubeTech, where he covers the latest news, reviews, and insights on gadgets, gaming, and technology. With over a decade of experience in the industry, he has collaborated with leading brands and built a reputation for making complex tech easy to understand for everyday readers. Based in Alberta, Canada, Mokube connects with a growing global audience while juggling work, gaming, family, school, and an ever-expanding pile of unopened gadget boxes.

Related Posts

How to Import Amazon Products to WordPress WooCommerce in Bulk (Complete Guide)

August 31, 2026

How to Set Up WooCommerce in WordPress (Complete Beginner’s Guide)

August 31, 2026

How to Make a Transparent Background in Adobe XD (Complete Guide)

August 29, 2026

How to Stop Auto Download in WhatsApp (Step-by-Step Guide)

August 29, 2026
Search
New Arrivals
  • Apple iPhone 13 Apple iPhone 13
  • Apple iPhone 13 mini Apple iPhone 13 mini
  • Apple iPad mini (2021) Apple iPad mini (2021)
  • Apple iPad 10.2 (2021) Apple iPad 10.2 (2021)
  • Apple Watch Edition Series 7 Apple Watch Edition Series 7
  • Apple Watch Series 7 Apple Watch Series 7
LASTEST POST

How to Import Amazon Products to WordPress WooCommerce in Bulk (Complete Guide)

August 31, 2026

How to Set Up WooCommerce in WordPress (Complete Beginner’s Guide)

August 31, 2026

How to Make a Transparent Background in Adobe XD (Complete Guide)

August 29, 2026

How to Stop Auto Download in WhatsApp (Step-by-Step Guide)

August 29, 2026
Facebook X (Twitter) Instagram Pinterest YouTube TikTok Threads
  • Terms and Conditions
  • Contact Us
  • Privacy Policy
  • Past Collaboration
  • About Us
  • Disclaimer
  • Meet the Team
  • Join Our Team
© 2026 MokubeTech. | All rights reserved | If you buy something via one of our affiliate links, Mokubetech may earn a commission.

Type above and press Enter to search. Press Esc to cancel.