Updating XAMPP without a headache

After some years the time has come to update my local WAMP stack to a more recent PHP version. I also made good experiences with WAMP (the other cool stack for Windows), but I’ll stick with XAMPP and install 1.8.2. This will also make things easier.

  1. Rename the old xampp installation directory C:\xampp (or where you installed it) to C:\_xampp
  2. Install new XAMPP under C:\xampp
  3. Copy all (needed) files/projects from C:\_xampp\htdocs to C:\xampp\htdocs
  4. Copy all (needed) databases from C:\_xampp\mysql\data to C:\xampp\mysql\data. EDIT: Don’t do that if your databases contain InnoDB tables. Use mysqldump instead.
  5. Check differences between both php.ini files, located in C:\xampp\php
  6. If you made changes on your MySQL configuration, don’t forget to check C:\xampp\mysql\bin\my.ini as well
  7. check your PHP Extensions in php/ext: you will need new versions of any additional PHP extensions (e.g. libpdf). Keep in mind that PHP 5.4 has been compiled using VC9 instead VC6 as in PHP 5.3 when chasing for downloads!
  8. Take over changes in C:\xampp\apache\conf\httpd.conf – most likely you’ll have some VirtualHost configurations
  9. Run the security check in XAMPP (http://localhost/security/index.php) to set the MySQL password to the same password you used in the old XAMPP installation (if you’re using a password)
  10. Be happy! You now shouldn’t need to change any path configurations, passwords etc. to run your web applications on your new PHP 5.4 stack!

The actual migration from PHP 5.3 to 5.4 shouldn’t be a problem, as there aren’t that many compatibility issues. I didn’t experience any PHP issues so far.

I was rather concerned about just copying the MySQL files – but it worked like a charm and is definitely quicker than doing mysqldumps and loads on many big databases – UNLESS you don’t have InnoDB tables in your databases. In this case better use mysqldump. In general it’s a good idea to keep an eye on the mysql_error.log in the data directory.

Good thing about this approach: you still have your old XAMPP installation at hand which you can reuse by simply renaming the two directories. Always be backed up!

Leave a Reply

Your email address will not be published. Required fields are marked *