Before starting the upgrade you have to install remi and epel repositories as follow:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
edit the repository and enable it
nano /etc/yum.repos.d/remi.repo
[remi]
enabled=1
[remi-php56]
enabled=1
make a copy of the follow directories:
cp -rf /usr/share/roundcubemail /usr/share/roundcubemail_old
cp -rf /etc/roundcubemail /etc/roundcubemail_oldcp /etc/httpd/conf.d/roundcubemail.conf /etc/httpd/conf.d/roundcubemail.conf_old
Uninstall roundcubemail
yum erase roundcubemail
run ad yum update command and check if there are any dependencies problem otherwise solve it before going on.
Upgrade PHP running:
yum upgrade php*
Restore /usr/share/roundcubemail_old in /usr/share/roundcubemail and /etc/roundcubemail_old in /etc/roundcubemail
Check php version running php -v
and enjoy