Upgrading PHP in XAMPP for Windows?
I would like to know how you upgrade PHP in Xampp for Windows? I tried to download the latest PHP version from the main PHP site but when I check (phpinfo) I still get that the previous version is still in use.
Solution 1:
Take a backup of your htdocs and data folder (subfolder of MySQL folder), reinstall upgraded version and replace those folders.
Note: In case you have changed config files like PHP (php.ini), Apache (httpd.conf) or any other, please take back up of those files as well and replace them with newly installed version.
Solution 2:
You can go through the following link as it helped me, should work for you as well. http://hype-free.blogspot.com/2007/07/updating-php-in-xampp-for-windows.html
Realizing that my answer helped couple of users, here is the edit from original link:
Edit:
First of all Always backup your data.
- Download the latest binary version of PHP (make sure to get the .zip package not the installer)
- De-archive it to a directory
- Overwrite the contents of directory in the php subfolder of your XAMPP installation directory.
- Overwrite the contents of the directory apache\bin with the newer versions.
- Now the trick: take the files which have a '_2' in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the '_2' part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.
NOTE: there are two directories to be updated with new version of files, namely php
sub-directory and apache/bin
sub-directory, inside XAMPP installation.
Solution 3:
Simplest method to upgrade PHP
in XAMPP
:
- Download latest portable version of
XAMPP
. - Extract the archive(not where
XAMPP
already installed). - Copy the
PHP
folder from the extracted archive. - Keep back up of
PHP
folder which is in installedXAMPP
directory. You can backup it like changing thePHP
folder name toPHP-old
or likePHP-version-number
- Paste the
PHP
folder which you copied from the extracted archive. - Replace the
php.ini
file with your backup folderphp.ini
file in case you have changed the default settings earlier. - That's all, start/restart the
server
.