HomeCpanelHow to Install libsodium and PHP Extension in WHM cPanel

How to Install libsodium and PHP Extension in WHM cPanel

libsodium is a popular and simple software library that supports encryption, decryption, signatures, password hashing, and other functions. Specifically, it is commonly used in web applications to encrypt data and ensure secure conversations. By installing Libsodium on your WHM cPanel server, you not only enhance your server’s security but also ensure that your apps can take full advantage of its powerful cryptography capabilities.

In this article, we will guide you through the process of installing Libsodium on a WHM cPanel server. Specifically, this detailed guide will include the, step-by-step installation instructions, and verification methods to ensure Libsodium is correctly installed.

Note:
You can only install the PHP extension `libsodium` if you have installed the `libsodium` library. Ensure you complete the installation of the `libsodium` library before proceeding with the PHP extension installation.

Uses of libsodium

-> Secure encryption and decryption of data
->Digital signatures to verify the integrity and origin of messages
->Password hashing to securely store passwords
->Key generation for cryptographic operations
->Random number generation for secure token creation

Steps to Install libsodium and PHP Extension in WHM cPanel

Install libsodium Library

1. Log in to WHM

  1. Open your web browser and navigate to your WHM login page. Typically, this will be https://yourserverip:2087.
  2. Log in with your root credentials.

2. Access Terminal in WHM

  1. In the WHM dashboard, locate the search bar on the left-hand side.
  2. Type “Terminal” and then click on the “Terminal” option which you will find under the “Server Configuration” section.

4. Install EPEL Repository

Libsodium is available in the Extra Packages for Enterprise Linux (EPEL) repository. If EPEL is not already installed on your system, you can install it by running the following command:

yum install epel-release -y

5. Install libsodium

With the EPEL repository enabled, you can now install libsodium. Execute the following command:

yum install libsodium -y

6. Verify libsodium Installation

To confirm that libsodium is installed correctly, you can check the version using the following command.

sodium_version

Once the libsodium is installed correctly, this command will display the installed version.

Install the libsodium PHP extension

Once the sodium library is installed, you can install the libsodium PHP extension. To install the libsodium PHP extension, you can follow the below steps.

1. Log into WHM as the rootuser.
2. Navigate to Home -> Software ->EasyApache 4.


3. In the Currently Installed Packages option, select the Customize button.


4. Click the PHP Extensions link on the left sidebar.


5. Enter libsodium in the search box.


6. Toggle the libsodium extension for each PHP version or for the specific PHP versions you require.

7. Once the extensions are selected, click the Review option in the left sidebar.


8. Scroll to the bottom of the page and select the Provision button.

Conclusion

Installing libsodium on your WHM cPanel server not only enhances your server’s cryptographic capabilities but also enables your applications to perform secure encryption, decryption, and various other cryptographic functions effectively. By following the procedures indicated in this post, you may quickly install libsodium and its PHP extension, resulting in a stable and secure server.

Scroll to Top