How to Upgrade XAMPP to PHP 8.5 on Windows

⏱ 10 min read 21
How to Upgrade XAMPP to PHP 8.5 on Windows

XAMPP is great until you need a PHP version it does not officially ship with.

You installed the latest XAMPP, opened phpinfo(), and still saw PHP 8.2.12 instead of PHP 8.5. Annoying, right?

PHP 8.5 may already be available, but that does not mean XAMPP is ready for it out of the box. If XAMPP does not support PHP 8.5 yet, you do not have to wait. You can upgrade PHP manually.

In this guide, I will show you how to manually upgrade PHP inside XAMPP to PHP 8.5, update phpMyAdmin, and fix common errors such as missing mysqli, session errors, deprecated warnings, and passwordless login issues.

Requirements

Before starting, make sure you have:

Step 1: Back Up Your Existing XAMPP Files

Before replacing anything, stop Apache and MySQL from the XAMPP Control Panel.

Then back up these folders and files:

C:\xampp\htdocs
C:\xampp\mysql\data
C:\xampp\php
C:\xampp\phpMyAdmin
C:\xampp\apache\conf\extra\httpd-xampp.conf

At minimum, rename the old PHP folder:

C:\xampp\php

to:

C:\xampp\php_8.2_backup

And rename the old phpMyAdmin folder:

C:\xampp\phpMyAdmin

to:

C:\xampp\phpMyAdmin_old

This gives you a quick rollback option if something goes wrong.

Step 2: Download PHP 8.5 for Windows

Download PHP 8.5 from the official PHP for Windows download page.

For XAMPP on Windows, choose:

PHP 8.5.x Windows x64 Thread Safe

Do not choose the Non Thread Safe version if you are running PHP through Apache in XAMPP.

After downloading the zip file, extract it and move the extracted PHP folder to:

C:\xampp\php

Your folder should look like this:

C:\xampp\php\php.exe
C:\xampp\php\php8ts.dll
C:\xampp\php\php8apache2_4.dll
C:\xampp\php\ext
C:\xampp\php\php.ini-development
C:\xampp\php\php.ini-production

Step 3: Create the php.ini File

The PHP zip package does not usually include an active php.ini file.

Inside:

C:\xampp\php

copy:

php.ini-development

and rename the copy to:

php.ini

The final file must be:

C:\xampp\php\php.ini

Make sure it is not accidentally named:

php.ini.txt

If Windows hides file extensions, enable them from:

File Explorer β†’ View β†’ Show β†’ File name extensions

Step 4: Configure php.ini

Open:

C:\xampp\php\php.ini

Find extension_dir and set it to:

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

Then enable the extensions needed by phpMyAdmin and most PHP projects:

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

If any of these lines start with a semicolon, remove it.

For example, change:

;extension=mysqli

to:

extension=mysqli

Step 5: Update Apache PHP Configuration

Open:

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

Make sure the PHP lines point to the new PHP folder:

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

Also make sure these files exist:

C:\xampp\php\php8ts.dll
C:\xampp\php\php8apache2_4.dll

If the file names are different in your PHP 8.5 folder, update the Apache configuration to match the real file names.

Step 6: Restart Apache

After changing PHP or Apache configuration, restart Apache from the XAMPP Control Panel:

Stop Apache
Start Apache

Do not just refresh the browser. Apache must be restarted to load the new PHP configuration.

Step 7: Check PHP 8.5

Create this file:

C:\xampp\htdocs\info.php

Add:

<?php phpinfo();

Open it in your browser:

http://localhost/info.php

Check these values:

PHP Version
Loaded Configuration File

You should see something like:

PHP Version: 8.5.x
Loaded Configuration File: C:\xampp\php\php.ini

Then search the page for:

mysqli

If the mysqli section appears, the MySQL extension is loaded correctly.

Why phpMyAdmin Breaks After Upgrading PHP

After replacing XAMPP’s bundled PHP with PHP 8.5, phpMyAdmin may stop working.

You may see errors like:

Deprecated: ... Implicitly marking parameter as nullable is deprecated

Or:

Error during session start
session_start(): Session cannot be started after headers have already been sent
Cannot modify header information - headers already sent

This happens because the phpMyAdmin version bundled with XAMPP may not be fully compatible with PHP 8.5. Deprecated warnings are printed before phpMyAdmin can start a session or send HTTP headers.

Hiding the warnings is only a temporary workaround. The better fix is to update phpMyAdmin manually.

Step 8: Update phpMyAdmin Manually

Stop Apache first.

Rename the old phpMyAdmin folder:

C:\xampp\phpMyAdmin

to:

C:\xampp\phpMyAdmin_old

Download the latest phpMyAdmin package from the official phpMyAdmin website.

Extract it, then rename the extracted folder to:

phpMyAdmin

Move it to:

C:\xampp\phpMyAdmin

The final folder should contain files like:

C:\xampp\phpMyAdmin\index.php
C:\xampp\phpMyAdmin\libraries
C:\xampp\phpMyAdmin\vendor

Step 9: Create config.inc.php for phpMyAdmin

Create or edit this file:

C:\xampp\phpMyAdmin\config.inc.php

Use this configuration for local XAMPP:

<?php
/**
 * phpMyAdmin configuration for local XAMPP
 */

declare(strict_types=1);

$cfg['blowfish_secret'] = 'xampp_phpmyadmin_local_secret_32_chars';

$i = 0;
$i++;

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

The important line is:

$cfg['Servers'][$i]['AllowNoPassword'] = true;

This is needed because the default XAMPP MySQL/MariaDB root user usually has no password.

Fix: The mysqli Extension Is Missing

If phpMyAdmin shows this error:

The mysqli extension is missing. Please check your PHP configuration.

Open:

C:\xampp\php\php.ini

Make sure extension_dir is set correctly:

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

Then enable:

extension=mysqli
extension=pdo_mysql

Also check that this file exists:

C:\xampp\php\ext\php_mysqli.dll

Restart Apache after saving the file.

Then open:

http://localhost/info.php

Search for:

mysqli

If the mysqli section appears, the extension is working.

Fix: php.ini Is Missing

If your new PHP folder does not contain php.ini, that is normal.

The PHP zip package usually includes these templates instead:

php.ini-development
php.ini-production

For local development, copy:

php.ini-development

and rename it to:

php.ini

Then edit the new php.ini file and enable the required extensions.

Fix: Login Without a Password Is Forbidden

If phpMyAdmin shows:

Login without a password is forbidden by configuration

Open:

C:\xampp\phpMyAdmin\config.inc.php

Find:

$cfg['Servers'][$i]['AllowNoPassword'] = false;

Change it to:

$cfg['Servers'][$i]['AllowNoPassword'] = true;

Restart Apache.

Then log in with:

Username: root
Password: leave it blank

Final Working Configuration

Your PHP configuration should include:

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

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

Your Apache configuration should include:

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

Your phpMyAdmin configuration should include:

<?php
declare(strict_types=1);

$cfg['blowfish_secret'] = 'xampp_phpmyadmin_local_secret_32_chars';

$i = 0;
$i++;

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

How to Log In to phpMyAdmin

Open:

http://localhost/phpmyadmin/

Use:

Username: root
Password: leave blank

If AllowNoPassword is set to true, phpMyAdmin should allow the login.

Final Checklist

Before finishing, check:

http://localhost/info.php

Confirm:

PHP Version: 8.5.x
Loaded Configuration File: C:\xampp\php\php.ini
mysqli: enabled
pdo_mysql: enabled
mbstring: enabled

Then open:

http://localhost/phpmyadmin/

Confirm that you can:

Conclusion

XAMPP is convenient, but it does not always ship with the newest PHP version right away.

If you need PHP 8.5 while XAMPP still provides an older PHP build, you can manually replace the PHP folder, create a proper php.ini, enable the required extensions, and update phpMyAdmin separately.

The most important steps are:

Use PHP 8.5 Thread Safe
Create C:\xampp\php\php.ini
Set extension_dir correctly
Enable mysqli and pdo_mysql
Update phpMyAdmin manually
Allow passwordless root login for local XAMPP
Restart Apache after each config change

Once everything is configured correctly, XAMPP can run PHP 8.5 even before an official XAMPP package includes it.