Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

Please advise.

share|improve this question
add comment

7 Answers

up vote 31 down vote accepted

Take a backup of your htdocs and data folder (subfolder of mysql folder), reinstall upgrade version and replace those folders.

share|improve this answer
    
Worked perfectly, Thanks a lot –  Stanley Ngumo Feb 1 '10 at 7:15
3  
I renamed my current XAMPP at C:\XAMPP to C:\XAMPP ORIG so that I could install the newest version of XAMPP at C:\XAMPP but still have my app's data and original version in case something went. I was scared after I installed the newest XAMPP and saw that it "overwrote" my XAMPP ORIG - on my C: drive, there was only C:\XAMPP - but relieved when my htdocs and mysql\data was in the new, updated version of XAMPP. –  Andrew Koper Dec 11 '12 at 17:31
    
I always used to do like this, but some databases in the backup data folder crashed when they are placed in the newly installed xampp folder. So, I'm always searching to upgrade PHP without apache upgrade. –  Sithu Jan 13 at 15:58
    
This answer is not clear!! Could you please elaborate more!!! –  whiteletters and blankspaces Mar 26 at 13:29
add comment

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.

  1. Download the latest binary version of PHP (make sure to get the .zip package not the installer)
  2. De-archive it to a directory
  3. Copy the contents of the directory in the php subfolder of your XAMPP installation directory, overwriting the files which are already present Overwrite the files which are already present in the apache\bin directory with the newer versions.
  4. 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.
share|improve this answer
add comment

I think you need to actually download and install XAMPP with the desired PHP version. I dont think you can just upgrade the components of XAMPP individually unless there is a facility provided for this within XAMPP itself.

share|improve this answer
add comment

download your desired version of php binary from http://windows.php.net/download/ website. download Thread Safe binary zip version. Unzip the downloaded version of the PHP in a separate folder. Please make sure that your new php folder name is not "PHP". May be you can use filder name as the version name. For example for php 5.4 you can use php54.

Copy the new php folder into your xampp folder. Now go to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. Change the following variables:

Variable PHPINIDir to be / Varaible LoadModule to be //php5apache2_2.dl

Save the file httpd-xampp.conf. Restart your XAMPP apache server. If your server get restarted successfully then your server php version is upgraded.

share|improve this answer
add comment

There are newer beta versions of Xampp that come with newer PHP upgrades.

you should check at www.apachefriends.org

share|improve this answer
add comment

I don't have enough reputation to comment yet, but, to add to ssharma's answer:

After you copy your htdocs folder to a safe place, just export your databases from PHPmyadmin. Simply go to each of your databases and click on the export tab at the top. Export them as sql (or whatever, really - just remember what you chose). Upgrade your XAMPP installation. Now, in the new version of XAMPP, create the databases that you want to re-insert. Example: you have a database named 'test' that you exported from your old installation, name the new, empty database the same thing. Now, go into 'test' and hit the import button along the top (right next to the export button). Click on choose file, find the sql file that you exported earlier (should be 'test.sql') and import. Your tables and data will be in place.

NOTE: There's an option to export the entire collection of databases (it names the file 127.0.0.1.sql). But, I've never had much luck getting it to import correctly. Do each of your databases separately to ensure it works. I made this post kind of long-winded, but that's because I like to write for the people that don't know exactly what they're doing yet (I, myself, was there not too long ago (all of us were at some point)).

Shorthand version of my answer:
1) Export your databases individually
2) Import into your new installation of XAMPP

share|improve this answer
add comment

http://www.apachefriends.org/en/xampp-windows.html

In this site you can get

XAMPP Add-Ons

by using this add on you can upgrade the latest versions.

share|improve this answer
    
All the zipped folders/installation executable files I download from this link is either empty or corrupted! Please help? –  marienke Sep 16 '13 at 8:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.