How to upgrade to php53u with Plesk

I was pointed to a thread by parallels as a solution for “plesk not recognizing my upgrade to php53 from the IUS Repository (php53u)” … this was NOT helpful at all so I’m posting my workaround and temporary fix until parallels can come up with something better. Their solution was to DOWNGRADE php on my production server which left a large number of my customers with broken sites!

However – here is the workaround for installing/upgrading php to the IUS Repository version php53u:

*Prerequisite: make sure you have enable php53 support and upgraded php to 5.3 in plesk
1) remove php53 packages without removing dependencies (plesk)
a) rpm -qa |grep php
b) copy /etc/php.ini to safe location
c) rpm -e –nodeps (list of php packages from the above command – with the exception of “psa-php53-configurator”)
2) install IUS Repository for YUM
a) wget http://dl.iuscommunity.org/pub/ius/s…el5.noarch.rpm
b) wget http://dl.iuscommunity.org/pub/ius/s…5-4.noarch.rpm
c) rpm -Uvh ius-release*.rpm epel-release*.rpm
3) install php53u from the IUS Repository
a) yum install list of packages from [1.a] changing the php53 to php53u
b) copy saved php.ini file to /etc/php.ini
c) /etc/init.d/httpd restart
*At this point php should be successfully upgraded. However, plesk will not see it as an installed component.
*The fix for this at the moment is:

1) install the following script:
<BEGIN BASH SCRIPT>
#!/bin/bash
MYSQLPASS=$(cat /etc/psa/.psa.shadow)

mysql -Ns -uadmin -p$MYSQLPASS -Dpsa -e ‘update Components set version=”5.3.8-2.ius.el5″ where name=”php” limit 1;’
<END BASH SCRIPT>

*MAKE SURE TO CHANGE “VERSION” TO WHATEVER THE CURRENT VERSION YOU INSTALLED IS!
*Create a crontab to run this script every 5/10/15/30 minutes (whatever you think is reasonable)

This is a temporary fix that will register the new php version as a component in the plesk. The reason for the cronjob is because whenever plesk restarts or you refresh the component list or upgrade/install anything via the plesk installer, the DB field for php version will be overwritten and plesk will no longer see php as an installed component.

Hope this helps out someone. Let me know if you need any more info or if this is not clear.

Share