Question
How do you install PHP extensions?
Answer
You can install PHP extensions via WHM or from the command line.
- Log into WHM as
root - Navigate to Home / Software / EasyApache 4
- Click the Customize button under Currently Installed Packages
- Click PHP Extensions
- Use the search bar to search for the extension you need to install. Example: zip
-
Mark the extension for installation by clicking the switch icon to the far right of the extension.
Note: This needs to be done for each version of PHP for which you need the PHP Extension.
- Click Review and review the output to ensure the PHP extension you marked for installation will be installed
- Click the Provision button to install the selected PHP extensions
Note: These steps will vary slightly depending on your operating system. We will be using the name of the package manager to differentiate which steps you should take. CentOS, AlmaLinux, Rocky Linux, RedHat, and CloudLinux all use the yum or dnf package managers to manage RPM packages. Ubuntu uses apt to manage DEB packages.
- Log in to the server via SSH or WHM's Terminal as the
rootuser -
Search for the name of the extension you're looking for:
# yum search ea-php74
# apt search ea-php74
-
Once you've determined the list of packages you'd like to install, list them after the install command:
# yum install ea-php74-php-cli ea-php74-php-mbstring ea-php74-php-pspell
# apt install ea-php74-php-cli ea-php74-php-mbstring ea-php74-php-pspell
- The command will ask you to confirm the installation. Press "y" then "Enter" and the installation will proceed
-
You can verify these extensions are now installed when visiting EasyApache or by running the following commands:
RedHat-based:
# rpm -qa | grep EXTENSION
Ubuntu:
# dpkg -l | grep EXTENSION
Note: You need to replace EXTENSION with the extension you want to verify is installed
Comments
0 comments
Article is closed for comments.