Until this article was written, Apache Friends only ships XAMPP with PHP 8.2 and there is no XAMPP version with PHP 8.4. If you want to upgrade PHP from your XAMPP to the latest version (PHP 8.4), the steps are actually quite straightforward.
Migrating your local PHP environment to the latest 8.4 release allows you to take advantage of new language features, performance improvements, and security patches without reinstalling XAMPP.
So let's start the upgrade process.
Backup the Existing PHP Environment
Before making any changes, ensure you can restore your setup if needed:
Locate your XAMPP installation directory, commonly
C:\xampp
.Compress the
php
folder into a ZIP archive (e.g.,php_backup.zip
).Save a copy of your custom
php.ini
if you've made modifications.
So when there is a problem, we just need to delete or rename the php
folder and extract the zip file that we created earlier to restore PHP to its original state.
Download PHP 8.4 Thread Safe ZIP Package
Now we have to download PHP 8.4 from its official website. I am using Windows so I will download the version for Windows OS.
Visit the official PHP for Windows download page: https://windows.php.net/download/
Select the latest PHP 8.4.x version.
Choose the "Thread Safe" ZIP package that matches your system architecture (x86 or x64).
Download and save the package to your preferred directory.
Replace the PHP Files in XAMPP
Before replacing it, stop Apache via the XAMPP Control Panel.
Extract the contents of the PHP 8.4 ZIP file.
Overwrite the existing
C:\xampp\php
folder with the extracted files.Ensure files replace the old PHP files directly; do not nest them inside an additional folder.
If you had a custom
php.ini
, copy relevant settings to the newphp.ini
inC:\xampp\php
.Alternatively, rename
php.ini-development
tophp.ini
if you prefer a default configuration and then tweak it as needed.
Verify the Upgrade
Now we check whether everything works as it should or not.
Restart Apache from the XAMPP Control Panel.
Check if Apache starts without errors.
Open a PHP info page or run
php -v
in the command prompt to confirm the PHP version displays as 8.4.If Apache fails to start, review error logs for missing DLLs or path issues.
Ensure your
php.ini
is properly configured for your environment.
If you don't find any errors, then congratulations! You have upgraded the PHP version in XAMPP to the latest PHP version.
Upgrading XAMPP's PHP runtime lets you experiment with the latest syntax improvements and ensures you're building on a supported, secure foundation. Happy coding!