How to Upgrade XAMPP to PHP 8.5 on Windows

⏱ 10 min read 1,014 Updated May 9, 2026
How to Upgrade XAMPP to PHP 8.5 on Windows

XAMPP is one of the easiest ways to run PHP, Apache, and MySQL locally on Windows. However, XAMPP does not always include the latest PHP version right away. If you want to test your projects with PHP 8.5, you can manually replace the PHP version inside your existing XAMPP installation.

Before You Start

Before upgrading PHP in XAMPP, make sure you back up your current setup. This is important because changing PHP files can affect Apache, phpMyAdmin, Composer, and your local projects.

You should back up these folders:

C:\xampp\htdocs
C:\xampp\php
C:\xampp\apache\conf
C:\xampp\apache\conf\extra

If you have important databases, export them from phpMyAdmin or back up your database folder carefully before continuing.

Step 1: Check Your Current PHP Version

First, check which PHP version your current XAMPP installation is using. Open Command Prompt and run:

php -v

You can also create a file named phpinfo.php inside your htdocs folder:

<?php
phpinfo();
?>

Then open this URL in your browser:

http://localhost/phpinfo.php

This page will show your current PHP version, loaded extensions, configuration file path, and Apache module details.

Step 2: Stop Apache in XAMPP

Open the XAMPP Control Panel and stop Apache before replacing any PHP files. Windows may lock PHP files while Apache is running, so this step is required.

You should also close any open terminal windows, code editors, or background tools that may be using PHP.

Step 3: Download PHP 8.5 for Windows

Go to the official PHP for Windows download page and download the PHP 8.5 ZIP package. For most XAMPP installations, you should choose:

PHP 8.5 x64 Thread Safe ZIP

The Thread Safe version is usually required because XAMPP uses PHP with Apache. After downloading the ZIP file, extract it to a temporary folder, for example:

C:\Users\YourName\Downloads\php-8.5

Step 4: Rename the Old PHP Folder

Go to your XAMPP installation directory:

C:\xampp

Find the existing php folder and rename it to:

php-old

Your old PHP folder should now be:

C:\xampp\php-old

This gives you a simple rollback option if the upgrade does not work correctly.

Step 5: Add the New PHP 8.5 Folder

Copy the extracted PHP 8.5 folder into your XAMPP directory:

C:\xampp

Rename the copied folder to:

php

Your new PHP path should now be:

C:\xampp\php

Step 6: Configure php.ini

Inside the new PHP folder, you may see files like:

php.ini-development
php.ini-production

For local development, copy php.ini-development and rename the copy to:

php.ini

You can also compare it with your old file:

C:\xampp\php-old\php.ini

Do not blindly copy every old setting. Some PHP settings may change between versions. Instead, copy only the settings and extensions you actually need.

Common settings to check include:

extension_dir="C:\xampp\php\ext"

extension=mysqli
extension=pdo_mysql
extension=curl
extension=openssl
extension=mbstring
extension=fileinfo
extension=gd
extension=intl
extension=zip

You may also want to update these values:

memory_limit=512M
upload_max_filesize=64M
post_max_size=64M
max_execution_time=120
date.timezone=Asia/Ho_Chi_Minh

Change the timezone value if you use a different location.

Step 7: Update Apache Configuration

Next, update Apache so it loads the new PHP version correctly. Open this file:

C:\xampp\apache\conf\extra\httpd-xampp.conf

Look for PHP-related lines such as:

LoadFile "C:/xampp/php/php8ts.dll"
LoadModule php_module "C:/xampp/php/php8apache2_4.dll"

Make sure these paths point to your new PHP folder:

C:/xampp/php

Also confirm that PHP files are handled correctly:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>

Then confirm the PHP configuration path:

PHPIniDir "C:/xampp/php"

Step 8: Update the Windows PATH Variable

If you use PHP from Command Prompt, you should update the Windows PATH variable.

Open Windows search and type:

Environment Variables

Then open Edit the system environment variables and go to:

Environment Variables > System variables > Path

Remove old PHP paths if needed, then add:

C:\xampp\php

After saving, close and reopen Command Prompt. Then run:

php -v

You should now see PHP 8.5.

Step 9: Restart Apache

Open the XAMPP Control Panel and start Apache again.

If Apache starts successfully, open:

http://localhost/phpinfo.php

Confirm that the PHP version is now PHP 8.5. You should also test one of your local projects:

http://localhost/your-project

Common Problems After Upgrading

Apache Does Not Start

If Apache fails to start, check the Apache error log:

C:\xampp\apache\logs\error.log

If you see an error like this:

Cannot load php8apache2_4.dll

You may have downloaded the wrong PHP package. Make sure you are using the Thread Safe x64 build.

Missing VCRUNTIME DLL

If Windows shows a missing Visual C++ runtime error, install the latest Microsoft Visual C++ Redistributable package and restart Apache.

PHP Extensions Are Not Loading

Open your php.ini file and confirm this setting:

extension_dir="C:\xampp\php\ext"

Then check whether the required extension files exist inside:

C:\xampp\php\ext

For example:

php_mysqli.dll
php_pdo_mysql.dll
php_curl.dll
php_mbstring.dll

phpMyAdmin Does Not Work

If phpMyAdmin breaks after upgrading PHP, your phpMyAdmin version may not fully support PHP 8.5. In that case, update phpMyAdmin separately or use a newer XAMPP release when available.

Step 10: Test Composer

If you use Composer, run:

composer diagnose

Then check your project platform requirements:

composer check-platform-reqs

Some older packages may not support PHP 8.5 yet. If you are working with Laravel, WordPress, Symfony, CodeIgniter, Magento, or legacy PHP projects, test everything carefully before switching your main local environment.

Should You Upgrade XAMPP to PHP 8.5?

You should upgrade if:

  • You want to test your applications with PHP 8.5.
  • You are preparing your projects for future hosting upgrades.
  • Your framework or CMS already supports PHP 8.5.
  • You want to try new PHP language features.

You may want to wait if:

  • Your project depends on old packages.
  • Your CMS or framework has not confirmed PHP 8.5 support.
  • You rely on older PHP extensions.
  • You need maximum stability for client work.

A safer option is to keep your current XAMPP installation and create a separate test environment for PHP 8.5.

Rollback Plan

If something goes wrong, you can restore the old PHP version.

First, stop Apache. Then rename or delete:

C:\xampp\php

Rename your backup folder:

C:\xampp\php-old

back to:

C:\xampp\php

Start Apache again from the XAMPP Control Panel. Your old PHP version should now be restored.

Final Thoughts

Upgrading XAMPP to PHP 8.5 on Windows is possible, but you should do it carefully. The most important steps are backing up your current XAMPP folder, downloading the correct Thread Safe PHP build, updating Apache configuration, and testing all required PHP extensions.

For local development, upgrading is a useful way to prepare your projects for the latest PHP ecosystem. For production projects, always test compatibility before deploying any code to a live server.