How to: Upgrade the System PHP Version ====================================== InterWorx utilizes its own, internal, version of PHP. This allows system administrators the freedom to choose the system-level version of PHP for the server. .. note:: Unless otherwise specified, new installs of InterWorx will automatically update the system PHP version to a current stable version. .. warning:: This documentation should only be used to upgrade the existing system PHP version to a higher version. Downgrading the system PHP version requires different steps and **is not recommended** due to potential unforeseen compatibility issues that may arise with other packages. .. contents:: To Upgrade the System PHP Version in EL7 ---------------------------------------- #. Log in to the server at the CLI as root, either via SSH or from the terminal #. Check the current PHP version. In this example, the server is currently using PHP 8.0: .. code-block:: [root@server ~]# php -v PHP 8.0.27 (cli) (built: Jan 3 2023 16:17:26) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.27, Copyright (c) Zend Technologies [root@server ~]# #. Enable the repo for the desired PHP version. The following example uses PHP 8.1: .. code-block:: yum-config-manager --enable remi-php81 #. Use the following yum command to upgrade the PHP version and related installed packages: .. code-block:: yum upgrade php* #. Check the PHP version, again, to make sure that it was updated: .. code-block:: [root@server ~]# php -v PHP 8.1.14 (cli) (built: Jan 4 2023 06:45:14) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.1.14, Copyright (c) Zend Technologies [root@server ~]# #. Run the following to refresh the PHP versions available to InterWorx. This will also update the Webserver page in NodeWorx to reflect the change. This command can take 15-30 seconds to resolve: .. code-block:: ~iworx/bin/php-fpm.pex --refresh-available-versions To Upgrade the System PHP Version in EL8 ---------------------------------------- #. Log in to the server at the CLI as root, either via SSH or from the terminal #. Check the current PHP version. In this example, the server is currently using PHP 8.0: .. code-block:: [root@almainstalltest ~]# php -v PHP 8.0.28 (cli) (built: Feb 14 2023 11:05:44) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.28, Copyright (c) Zend Technologies with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies [root@almainstalltest ~]# #. Reset the PHP module .. code-block:: dnf module reset php #. Use the module install command to upgrade the PHP version and related installed packages, replacing {version} with the desired PHP version .. code-block:: dnf -y module install php:remi-{version} - For example, this is the command to update the system PHP version to PHP 8.1: .. code-block:: dnf -y module install php:remi-8.1 #. Check the PHP version, again, to make sure that it was updated: .. code-block:: [root@server ~]# php -v PHP 8.1.19 (cli) (built: May 10 2023 13:43:03) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.1.19, Copyright (c) Zend Technologies with Zend OPcache v8.1.19, Copyright (c), by Zend Technologies [root@server ~]# #. Run the following to refresh the PHP versions available to InterWorx. This will also update the Webserver page in NodeWorx to reflect the change. This command can take 15-30 seconds to resolve: .. code-block:: ~iworx/bin/php-fpm.pex --refresh-available-versions