How To: Install PHP Extensions

Server Administrators may install PHP extensions either via the NodeWorx Interface, or using the CLI

To Install PHP Extensions Using NodeWorx

  1. Log into NodeWorx from the browser (https://ip.ad.dr.ess:2443/nodeworx)

  2. From NodeWorx, navigate to System Services > Web Server > PHP Extensions

  3. Under the desired PHP version, select the checkbox next to the corresponding PHP Extension to be installed. The following screenshot is a truncated list

    Note

    Greyed-out checkboxes indicate that the package is either unavailable or already installed for the corresponding version of PHP

    nodeworx php extensions page
  4. Click Go

To Install PHP Extensions Using the CLI

InterWorx provides access to the REMI repository for quick and simple installation of PHP extensions such as: zip, ioncube-loader, and more using normal yum commands.

To Install a PHP Extension for the System PHP Version

Note

The System PHP configuration and extensions, are separate from the extensions for PHP versions provided by the Multiple-PHP tool, even when the PHP version number is the same. More information on the Multiple-PHP tool can be found here.

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. Run yum install php-{extension} replacing {extension} with the name of the extension. For example, to install the ioncube-loader module:

    yum install php-ioncube-loader
    
  3. Restart Apache and PHP-FPM

    systemctl restart httpd
    ~iworx/bin/php-fpm.pex --restart-fpm
    

To Install a PHP Extension for a PHP Version Provided by the Multiple-PHP Tool

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. Run yum install php{version}-php-{extension} replacing {version} with the PHP version number, without periods, and replacing {extension} with the name of the the extension. For example, to install the ioncube-loader module for PHP 7.4:

    yum install php74-php-ioncube-loader
    
  3. Restart Apache and PHP-FPM

    systemctl restart httpd
    ~iworx/bin/php-fpm.pex --restart-fpm
    

To Find a PHP Extension Package Without the Exact Package Name

Not every package will directly adhere to the php-{extension} format. Additionally, the name of the exact package may be unknown to the administrator. Therefore, it may be necessary to search for the desired extension in yum.

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. Run yum search {extension} replacing {extension} with the desired PHP extension. For example, it may be difficult to know that the zip module PHP extension is named php-pecl-zip. A good way to search for this extension is to search via yum search zip and then stripping out packages that are unrelated to PHP by grepping results that contain php:

    [root@test ~]# yum search zip | grep php
     * remi-php73: mirror.pit.teraswitch.com
    iworxphp72-php-zip.x86_64 : ZIP archive management extension for PHP
    php-mcnetic-zipstreamer.noarch : Stream zip files without i/o overhead
    php-pclzip.noarch : Compression and extraction functions for Zip formatted
    php-pecl-zip.x86_64 : A ZIP archive management extension
    php-zipstream.noarch : Streaming dynamic zip from PHP without writing to the
    php54-php-pecl-zip.x86_64 : A ZIP archive management extension
    php55-php-pecl-zip.x86_64 : A ZIP archive management extension
    php56-php-pecl-zip.x86_64 : A ZIP archive management extension
    php70-php-pecl-zip.x86_64 : A ZIP archive management extension
    php71-php-pecl-zip.x86_64 : A ZIP archive management extension
    php72-php-pecl-zip.x86_64 : A ZIP archive management extension
    php73-php-pecl-zip.x86_64 : A ZIP archive management extension
    php74-php-pecl-zip.x86_64 : A ZIP archive management extension
    php80-php-pecl-zip.x86_64 : A ZIP archive management extension
    php81-php-pecl-zip.x86_64 : A ZIP archive management extension