PHP Module: Mcrypt


Last modified: February 6, 2020

Overview

The mcrypt PHP module provides an interface to the mcrypt library and supports encryption. The cPanel-provided EasyApache 4 profiles include the mcrypt PHP module by default.

Compatibility

As of PHP 7.2, this module is only available through the PHP Extension Community Library (PECL).

Requirements

This module depends on the mcrypt library, which EasyApache 4 installs to the /opt/cpanel/libmcrypt directory when you install the mcrypt module.

Installation steps

In the interface

To install or uninstall the mcrypt PHP module, use WHM’s EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4).

On the command line

To install the mcrypt PHP module, perform the following steps:

  1. On the command line as the root user, copy the files from the /opt/cpanel/libmcrypt/lib64/ directory to the /opt/cpanel/libmcrypt/lib/ directory with the following command:

    rsync -avH /opt/cpanel/libmcrypt/lib64/ /opt/cpanel/libmcrypt/lib/

  2. Install the mcrypt module with the following command:

    ea-php72-pecl install mcrypt-1.0.2

  3. When the system prompts for the libmcrypt prefix, enter the following directory path:

    /opt/cpanel/libmcrypt

Additional Documentation