User Tools

Site Tools


php-upgrade

Please see 'yum replace' for installing the correct package

Upgrading PHP

The following guide will use yum-plugin-replace to upgrade php.



WARNING!

Before upgrading, please make sure plesk is NOT installed

service psa status
rpm -qa | grep -i 'psa\|plesk'
IF you run the following guide and plesk IS installed, it will remove the 'php-psa' module which will fully remove plesk from your device!!!




1 ) Note: BACKUP php.ini file before you do anything!

cp /etc/php.ini{,.$(date +%Y-%m-%d).back}

2 ) Check version currently installed:
php -v
PHP 5.3.3 (cli) (built: Oct 30 2014 20:12:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

3) Find package you wish to upgrade to:
# yum info php56u.x86_64 | grep -i 'name\|version\|release\|size'

Name        : php56u
Version     : 5.6.15
Release     : 1.ius.el6
Size        : 2.7 M

4) php -m > /home/php-modulebackup
5)
You will not be able to simply install the new package, it will conflict with lots of installed packages.
What we need to do it 'replace' packages (Note: you may need to run yum-complete-transaction first).
yum replace php --replace-with=php56u

6)
php -m > /home/php-modulebackupUpgrade
diff the two file

php-upgrade.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1