Upgrade PHP on RedHat 7 and CentOS 7
You should almost always upgrade to the latest version of PHP supported by ownCloud, if and where possible. And if you’re on a version of PHP older than 7.3.0 you must upgrade. This guide takes you through upgrading your installation of PHP to one of the supported PHP versions (7.3 and 7.4) on Red Hat or CentOS 7.
To upgrade to PHP 7.3 you first need to subscribe to the Red Hat Software Collections channel repository to download and install the PHP 7.3 package in RHEL 7 (if you’ve not done this already). This documentation uses the same command as you will find there.
Ensure that you have
Install subscription manager
Add the required repositories for the PHP packages
Then, proceed by installing the required PHP 7.3 packages. You can use the command below to save you time.
yum install \ rh-php73 \ rh-php73-php \ rh-php73-php-cli \ rh-php73-php-curl \ rh-php73-php-devel \ rh-php73-php-gd \ rh-php73-php-intl \ rh-php73-php-ldap \ rh-php73-php-mbstring \ rh-php73-php-mysqlnd \ rh-php73-php-opcache rh-php73-php-pdo \ rh-php73-php-pear \ rh-php73-php-xml \ rh-php73-php-xmlrpc \ rh-php73-php-zip
Next, you need to enable PHP 7.3 and disable PHP 5.6 system-wide. To enable PHP 7.3 system-wide, run the following command:
cp /opt/rh/rh-php73/enable /etc/profile.d/rh-php73.sh source /opt/rh/rh-php73/enable
Then, you need to disable loading of the PHP 5.6 Apache modules. You can do this either by changing their names, as in the example below, or deleting the files.
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php56.off mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php56.off
With that done, you next need to copy the PHP 7.3 Apache modules into place; that being the two Apache configuration files and the shared object file.
cp /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php73-php.conf /etc/httpd/conf.d/ cp /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php73-php.conf /etc/httpd/conf.modules.d/ cp /opt/rh/httpd24/root/etc/httpd/modules/librh-php73-php7.so /etc/httpd/modules/