Updating PHP in XAMPP for Windows

XAMPP is a great suite to quickly get up and running with Apache, PHP, Perl and MySQL. Warning! It is not aimed to be used in a production environment! Its settings are geared towards ease of use rather then security!

However I went against my own advice and used it in a couple of instances, however these are not public facing sites, rather internal and heavily firewalled services. Even so whenever a security update to PHP comes out, I feel the need to use the new version. Here is how you can do it, without waiting for the official XAMPP package to update (you really can’t criticize them for not updating faster, since it is a development not a production server and as such minor PHP releases shouldn’t influence your code).

Warning! Use these instructions on your own risk. They are written to the best of my knowledge, however I can’t make any guarantees. 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
  4. Overwrite the files which are already present in the apachebin directory with the newer versions.
  5. 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 apachebin 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.

Schreibe einen Kommentar