Upgrading to PHP 5.2.17 in Parallels Plesk 9.5.2

I recently needed to do a test install of the Magento on one of my servers for a client who was using Parallels Plesk version 9.52. It seems their version of Plesk running on CentOS only had PHP 5.1.6 installed. The version of Magento I was installing required a version of PHP that >= 5.2. I ran into a few problems while doing the upgrade but eventually was able to get the required version of PHP installed.  I thought I would document the steps I took here for anybody else who runs into the same issue.

The following commands were executed from the command line while logged into the Plesk server as admin:

  1. Enable Atomicorp Yum update Repository which has stable versions of PHP.
    wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh

  2. Run the command to update PHP 
    yum update php


    This resulted in the following error message:
    php-sqlite2-5.1.6-200705230937.x86_64 from installed has depsolving problems
      --> Missing Dependency: php <= 5.2.0 is needed by package php-sqlite2-5.1.6-200705230937.x86_64 (installed)
    Error: Missing Dependency: php <= 5.2.0 is needed by package php-sqlite2-5.1.6-200705230937.x86_64 (installed)

  3. I tried running it again but this time skipping dependencies:
    yum update php --skip-broken

    This didn't work.


  4. So at this point I did a little searching online. Turns out that the offending package (php-sqlite2) is needed by the built in Plesk Site Builder tool. Since I don't use this at all I ran the following command:
    yum remove php-sqlite2

    This removed the dependency.


  5. Than I ran the previous command again:
    yum update php

    The package then proceeded to install without any additional errors.

  6. I then restarted the Apache process from the Plesk Admin services panel.

  7. Then from the command line I tested out that it installed ok by running:
    php -v

    Which returned:

    PHP 5.2.17 (cli) (built: Jan  7 2011 10:39:29)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies


  8. Viola! It worked. Hope this helps you out if you find yourself in the same situation.