To upgrade PHP version in xampp on windows; Through this tutorial, you will learn two ways to upgrade/update php version in xampp on windows.
How To Upgrade/Update PHP Version In XAMPP On Windows
There are two ways upgrade php version in xampp on windows; is as follows:
- Method 1: To upgrade PHP in XAMPP by Download Latest PHP
- Method 2: To upgrade/update PHP version in XAMPP on windows using cmd
Method 1: To upgrade PHP in XAMPP by Download Latest PHP
To upgrade PHP in XAMPP, you can follow these steps:
- Download the latest version of PHP that is compatible with XAMPP from the official PHP website. Make sure to download the thread-safe version of PHP for Windows if you are using XAMPP on Windows.
- Extract the downloaded PHP archive to a temporary folder on your computer.
- Stop the Apache server in XAMPP by clicking on the “Stop” button in the XAMPP Control Panel.
- Navigate to the XAMPP installation directory and locate the “php” folder. Rename this folder to “php_old” to keep a backup of the existing PHP installation.
- Copy the extracted PHP files and folders from the temporary folder to the “php” folder in XAMPP.
- Start the Apache server in XAMPP by clicking on the “Start” button in the XAMPP Control Panel.
- Open a web browser and go to “http://localhost/dashboard/phpinfo.php” to verify that the new version of PHP has been installed and is working correctly.
Method 2: To upgrade/update PHP version in XAMPP on windows using cmd
You can upgrade PHP version in XAMPP using the terminal by following these steps:
- Download the latest version of PHP that is compatible with XAMPP from the official PHP website. Make sure to download the thread-safe version of PHP for Windows if you are using XAMPP on Windows.
- Extract the downloaded PHP archive to a temporary folder on your computer.
- Open a terminal window and navigate to the XAMPP installation directory. On Windows, you can do this by typing the following command and pressing Enter:
- cd C:\xampp
- Stop the Apache server in XAMPP by running the following command:
- xampp\apache\bin\httpd.exe -k stop
- Navigate to the XAMPP “php” folder by running the following command:
- cd php
- Rename the existing PHP folder to create a backup. You can do this by running the following command:
- rename php php_old
- Copy the extracted PHP files and folders from the temporary folder to the XAMPP “php” folder. You can do this by running the following command:
- xcopy C:\xampp\php /s /e
- Note: Replace
<path_to_extracted_php_files>
with the actual path to the folder where you extracted the PHP files.
- Start the Apache server in XAMPP by running the following command:
- xampp\apache\bin\httpd.exe -k start
- Open a web browser and go to “http://localhost/dashboard/phpinfo.php” to verify that the new version of PHP has been installed and is working correctly.
Note: It’s always recommended to backup your XAMPP installation before making any changes to it. Also, upgrading PHP in XAMPP may require you to update any extensions or libraries that you have installed.
Conclusion
To upgrade PHP version in xampp on windows; Through this tutorial, you will learn two ways to upgrade/update php version in xampp on windows.