From ef939db69ba2cf94592e21738491365f5555910e Mon Sep 17 00:00:00 2001 From: michag86 Date: Sun, 6 Jan 2019 15:45:42 +0100 Subject: [PATCH 1/4] Updating to PHP 7.2 updating to php72 adding rh-php72-php-intl adding uninstallation commands for old php54 (sometimes updating breaks the apache config, because php54 config is recreated) symlink command for binary for short paths for usage in cron --- .../installation/php_70_installation.rst | 82 -------------- .../installation/php_72_installation.rst | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 82 deletions(-) delete mode 100644 admin_manual/installation/php_70_installation.rst create mode 100644 admin_manual/installation/php_72_installation.rst diff --git a/admin_manual/installation/php_70_installation.rst b/admin_manual/installation/php_70_installation.rst deleted file mode 100644 index d14510dfe..000000000 --- a/admin_manual/installation/php_70_installation.rst +++ /dev/null @@ -1,82 +0,0 @@ -========================================= -Installing PHP 7.0 on RHEL 7 and CentOS 7 -========================================= - -PHP 5.4 has been end-of-life since September 2015 and is no longer supported by the PHP team. RHEL 7 still ships with PHP 5.4, and Red Hat supports it. Nextcloud 14+ requires PHP 7.0 or newer, so upgrading to 7.0 is required. - -RHEL 7 Upgrade to PHP 7.0 -------------------------- - -To upgrade to PHP 7.0, you must use the Software Collections (SCL) repository to be in compliance with your RHEL support contract, and not any other third-party repository. Follow these steps to install PHP 7.0 from SCL. First you must use your Subscription Manager to enable SCL:: - - subscription-manager repos --enable rhel-server-rhscl-7-eus-rpms - -Then install PHP 7.0 and these modules:: - - yum install rh-php70 rh-php70-php rh-php70-php-gd rh-php70-php-mbstring - -You must also install the updated database module for your database. This installs the new PHP 7.0 module for MySQL/MariaDB:: - - yum install rh-php70-php-mysqlnd - -If you are using the Nextcloud LDAP app, you need this module:: - - yum install rh-php70-php-ldap - -Disable loading the old PHP Apache modules by changing their names:: - - mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off - mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off - -Symlink the PHP 7.0 Apache modules into place:: - - ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php70-php.conf /etc/httpd/conf.d/ - ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php70-php.conf /etc/httpd/conf.modules.d/ - ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php70-php7.so /etc/httpd/modules/ - -Then restart Apache:: - - service httpd restart - -Verify with ``phpinfo`` that your Apache server is using PHP 7.0 and loading the -correct modules; see :ref:`label-phpinfo` to learn how to use phpinfo. - - -CentOS 7 Upgrade to PHP 7.0 ---------------------------- - -To upgrade to PHP 7.0, use the Red Hat Software Collections (SCL) repository. - -Follow these steps to install PHP 7.0 from SCL. First install the SCL repository:: - - yum install centos-release-scl - -Then install PHP 7.0 and these modules:: - - yum install rh-php70 rh-php70-php rh-php70-php-gd rh-php70-php-mbstring - -You must also install the updated database module for your database. This installs the new PHP 7.0 module for MySQL/MariaDB:: - - yum install rh-php70-php-mysqlnd - -If you are using the Nextcloud LDAP app, you need this module:: - - yum install rh-php70-php-ldap - -Disable loading the old PHP Apache modules by changing their names:: - - mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off - mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off - -Symlink the PHP 7.0 Apache modules into place:: - - ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php70-php.conf /etc/httpd/conf.d/ - ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php70-php.conf /etc/httpd/conf.modules.d/ - ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php70-php7.so /etc/httpd/modules/ - -Then restart Apache:: - - service httpd restart - -Verify with ``phpinfo`` that your Apache server is using PHP 7.0 and loading the -correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. diff --git a/admin_manual/installation/php_72_installation.rst b/admin_manual/installation/php_72_installation.rst new file mode 100644 index 000000000..d1674b50e --- /dev/null +++ b/admin_manual/installation/php_72_installation.rst @@ -0,0 +1,100 @@ +========================================= +Installing PHP 7.2 on RHEL 7 and CentOS 7 +========================================= + +PHP 5.4 has been end-of-life since September 2015 and is no longer supported by the PHP team. RHEL 7 still ships with PHP 5.4, and Red Hat supports it. Nextcloud 14+ requires PHP 7.0 or newer, so upgrading to 7.0 or newer is required. + +RHEL 7 Upgrade to PHP 7.2 +------------------------- + +To upgrade to PHP 7.2, you must use the Software Collections (SCL) repository to be in compliance with your RHEL support contract, and not any other third-party repository. Follow these steps to install PHP 7.2 from SCL. First you must use your Subscription Manager to enable SCL:: + + subscription-manager repos --enable rhel-server-rhscl-7-eus-rpms + +Then install PHP 7.2 and these modules:: + + yum install rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl + +You must also install the updated database module for your database. This installs the new PHP 7.2 module for MySQL/MariaDB:: + + yum install rh-php72-php-mysqlnd + +If you are using the Nextcloud LDAP app, you need this module:: + + yum install rh-php72-php-ldap + +Disable loading the old PHP Apache modules by changing their names:: + + mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off + mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off + +Symlink the PHP 7.2 Apache modules into place:: + + ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/ + ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/ + ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/ + +Then restart Apache:: + + service httpd restart + +Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the +correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. + +If there is no requirement for php 5.4, you can remove it: + + yum remove php* + rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off + +After uninstalling, you can symlink the PHP 7.2 binary to use the short path (e.g. for cron):: + + ln -s /opt/rh/rh-php72/root/usr/bin/php /usr/bin/php + + +CentOS 7 Upgrade to PHP 7.2 +--------------------------- + +To upgrade to PHP 7.2, use the Red Hat Software Collections (SCL) repository. + +Follow these steps to install PHP 7.2 from SCL. First install the SCL repository:: + + yum install centos-release-scl + +Then install PHP 7.2 and these modules:: + + yum install rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl + +You must also install the updated database module for your database. This installs the new PHP 7.2 module for MySQL/MariaDB:: + + yum install rh-php72-php-mysqlnd + +If you are using the Nextcloud LDAP app, you need this module:: + + yum install rh-php72-php-ldap + +Disable loading the old PHP Apache modules by changing their names:: + + mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off + mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off + +Symlink the PHP 7.2 Apache modules into place:: + + ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/ + ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/ + ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/ + +Then restart Apache:: + + service httpd restart + +Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the +correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. + +If there is no requirement for php 5.4, you can remove it: + + yum remove php* + rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off + +After uninstalling, you can symlink the PHP 7.2 binary to use the short path (e.g. for cron):: + + ln -s /opt/rh/rh-php72/root/usr/bin/php /usr/bin/php From eef094990c517b7442e8803885e9a3ac90607d45 Mon Sep 17 00:00:00 2001 From: michag86 Date: Sun, 6 Jan 2019 15:47:28 +0100 Subject: [PATCH 2/4] change link to php72 --- admin_manual/installation/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_manual/installation/index.rst b/admin_manual/installation/index.rst index 12a286bf7..e6113e042 100644 --- a/admin_manual/installation/index.rst +++ b/admin_manual/installation/index.rst @@ -11,6 +11,6 @@ Installation installation_wizard command_line_installation apps_supported - php_70_installation + php_72_installation selinux_configuration nginx From d208240c04bd46ac361c6ff3c1fa1e60fabad9c9 Mon Sep 17 00:00:00 2001 From: michag86 Date: Thu, 10 Jan 2019 07:31:44 +0100 Subject: [PATCH 3/4] Additional changes from hanserasmus --- .../installation/php_72_installation.rst | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/admin_manual/installation/php_72_installation.rst b/admin_manual/installation/php_72_installation.rst index d1674b50e..205dc75b4 100644 --- a/admin_manual/installation/php_72_installation.rst +++ b/admin_manual/installation/php_72_installation.rst @@ -2,7 +2,7 @@ Installing PHP 7.2 on RHEL 7 and CentOS 7 ========================================= -PHP 5.4 has been end-of-life since September 2015 and is no longer supported by the PHP team. RHEL 7 still ships with PHP 5.4, and Red Hat supports it. Nextcloud 14+ requires PHP 7.0 or newer, so upgrading to 7.0 or newer is required. +PHP 5.4 has been end-of-life since September 2015 and is no longer supported by the PHP team. RHEL 7 still ships with PHP 5.4, and Red Hat supports it. However, seeing as PHP 7.0 has also now reached EOL, and from Nextcloud 14 onwards the Nextcloud team suggests using PHP 7.1+, it is strongly advised to upgrade your PHP version to 7.2. RHEL 7 Upgrade to PHP 7.2 ------------------------- @@ -23,11 +23,14 @@ If you are using the Nextcloud LDAP app, you need this module:: yum install rh-php72-php-ldap -Disable loading the old PHP Apache modules by changing their names:: +Disable loading the old PHP Apache modules by changing their names, for example:: mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off +Note: change your version number in the above command to correspond to the current php +version installed, for example "php70.off" + Symlink the PHP 7.2 Apache modules into place:: ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/ @@ -36,12 +39,12 @@ Symlink the PHP 7.2 Apache modules into place:: Then restart Apache:: - service httpd restart + systemctl restart httpd.service Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. -If there is no requirement for php 5.4, you can remove it: +If there is no requirement for your old PHP installation, you can remove it: yum remove php* rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off @@ -50,6 +53,10 @@ After uninstalling, you can symlink the PHP 7.2 binary to use the short path (e. ln -s /opt/rh/rh-php72/root/usr/bin/php /usr/bin/php +Any changes to the configuration of the previous used php installation don't apply to the new installation. Required changes for the new installation can be configured here:: + + /etc/opt/rh/rh-php72/ + CentOS 7 Upgrade to PHP 7.2 --------------------------- @@ -72,11 +79,14 @@ If you are using the Nextcloud LDAP app, you need this module:: yum install rh-php72-php-ldap -Disable loading the old PHP Apache modules by changing their names:: +Disable loading the old PHP Apache modules by changing their names, for example:: mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off +Note: change your version number in the above command to correspond to the current php +version installed, for example "php70.off" + Symlink the PHP 7.2 Apache modules into place:: ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/ @@ -85,12 +95,12 @@ Symlink the PHP 7.2 Apache modules into place:: Then restart Apache:: - service httpd restart + systemctl restart httpd.service Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. -If there is no requirement for php 5.4, you can remove it: +If there is no requirement for your old PHP installation, you can remove it: yum remove php* rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off @@ -98,3 +108,7 @@ If there is no requirement for php 5.4, you can remove it: After uninstalling, you can symlink the PHP 7.2 binary to use the short path (e.g. for cron):: ln -s /opt/rh/rh-php72/root/usr/bin/php /usr/bin/php + +Any changes to the configuration of the previous used php installation don't apply to the new installation. Required changes for the new installation can be configured here:: + + /etc/opt/rh/rh-php72/ From 662fefc2b2804a08178f6bab6f30fc79bd176775 Mon Sep 17 00:00:00 2001 From: michag86 Date: Mon, 14 Jan 2019 08:10:01 +0100 Subject: [PATCH 4/4] fixed a typo --- admin_manual/installation/php_72_installation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin_manual/installation/php_72_installation.rst b/admin_manual/installation/php_72_installation.rst index 205dc75b4..568fde375 100644 --- a/admin_manual/installation/php_72_installation.rst +++ b/admin_manual/installation/php_72_installation.rst @@ -44,7 +44,7 @@ Then restart Apache:: Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. -If there is no requirement for your old PHP installation, you can remove it: +If there is no requirement for your old PHP installation, you can remove it:: yum remove php* rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off @@ -100,7 +100,7 @@ Then restart Apache:: Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``. -If there is no requirement for your old PHP installation, you can remove it: +If there is no requirement for your old PHP installation, you can remove it:: yum remove php* rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off