Drupal-lovers

Who love to Drupal

Archive for the ‘Apache’ Category

Server Configuration

How to upgrade PHP version in XAMPP

Posted by drupallovers on May 16, 2012

Having been unable to find a definitive guide to upgrading the XAMPP PHP version to PHP 5.3.0rc2, I decided to improvise on a guide for installing the PHP 5.3 alpha.
My guide will describe how to upgrade the current XAMPP PHP version to the second release candidate of version 5.3. It is expected that this method will also work for the third release candidate when it is released later this month.

Step 1: Make backups

Before starting, make sure to backup any settings, custom modules and most importantly the htdocs directory, which contains your scripts and page resources. This directory is normally located atC:\xampp\htdocs\
Step 2: Preparation
  1. Download PHP 5.3.0rc2. I use the VC6 build in order to minimise any potential compatibility issues.
  2. It is also recommended that you download the latest Windows version of XAMPP. While this is an upgrade guide that shouldwork with previous versions of XAMPP, it is recommended that a fresh copy of the core files is used.
  3. Stop any instances of the Apache service that might be running.
Step 3: The upgrade
This guide will assume your XAMPP directory is C:\xampp\
  1. Extract the XAMPP archive to a directory of your choosing, I would recommend using the default C:\xampp\
  2. Extract the contents of the PHP archive to C:\xampp\php\, overwriting the contents of this directory with the new files.
  3. Open the file C:\xampp\apache\conf\extra\httpd-xampp.conf and ensure the following lines are present in this order:
    LoadFile "/xampp/php/php5ts.dll"
    LoadModule php5_module "/xampp/apache/bin/php5apache2_2.dll"
  4. Replace C:\xampp\php\php.ini with C:\xampp\php\php.ini-dist
    Uncomment the lines:

    ;extension=php_mbstring.dll
    ;extension=php_pdo_sqlite.dll
    Replace the line
    magic_quotes_gpc = On
    with
    magic_quotes_gpc = Off
  5. Copy all files in the C:\xampp\php\ to C:\xampp\apache\bin\ (do not copy the subdirectories or their contents).
After following the above steps, restart your Apache service (this can be done using C:\xampp\xampp-control.exe or manually through the control panel/command prompt). Your PHPinfo should indicate that the upgrade has been successful.
I will update this post if I discover any problems from using this method, or a cleaner (automated) means of performing the upgrade.
Advertisements

Posted in Apache, Php | 25 Comments »