EasyApache 4 (EA4) makes managing PHP Extensions very simple. If you are currently using EasyApache 3 (EA3), you should upgrade to EasyApache 4. In this guide, you will learn the steps to install the fileinfo PHP extension using EasyApache 4 from your Web Host Manager (WHM) and Command Line Interface (CLI).
Install from WHM
EasyApache 4 is designed as a user-interface for the yum program to integrate into WHM. However, it is important to note that you need to install the PHP extension separately for each PHP version. The instructions below provide the steps to follow to install the PHP extension fileinfo (for PHP versions 5.5, 5.6, 7.0, and 7.1) using WHM.
- Log into WHM as root.
- Type ‘easy‘ into the search field in the top left of WHM.
- Under the Software category, click on EasyApache 4.
- In the Currently Installed Packages section, click on the Customize button.
- Click on the PHP Extensions option from the left.
- In the Search field, type to enter ‘fileinfo‘.
- Click the toggle button(s) next to the PHP version(s) that you would like the PHP extension installed for.
- Click the Review option from the left.
- Confirm the options you selected are listed under the “Please review the following list of packages you are about to install by provisioning this profile.” section. Then, click the Provision button.
- Once the installation is completed, you will receive a message: “The provision process is complete”. Click the Done button to finish.
Now that you have completed installing the fileinfo PHP extension from WHM, you can view your phpinfo.php page to confirm it is enabled.
Install from CLI
EasyApache 4 is also designed to allow installation of PHP extensions via the Command Line Interface (CLI) using Yellowdog Updater Modified (yum). Again, it is important to note that you need to install the PHP extension separately for each PHP version.
Also, EA4’s packages for PHP modules and extensions use the ea-php##-php-module naming convention. Simply replace ## with the PHP version number (for our example: ’55’, ’56’, ’70’, and ’71’) and module with the name of the PHP module/extension (‘fileinfo’ in our example). The steps below indicate how you can install the PHP extension fileinfo from the CLI using yum.
- Connect to your server via an SSH connection.
- First, update cPanel by running the following command:
- Once “upcp” completes, run the following command:
yum install -y ea-php55-php-fileinfo ea-php56-php-fileinfo ea-php70-php-fileinfo ea-php71-php-fileinfo
Now that you have completed installing the fileinfo PHP extension from the CLI, you can confirm it is enabled by running the following command (replacing ## with the PHP version you want to check:
scl enable ea-php## 'php -i' | grep 'fileinfo'
[email protected] ~ $ scl enable ea-php56 'php -i' | grep 'fileinfo' Configure Command => './configure' ...'--enable-fileinfo=shared'...' /opt/cpanel/ea-php56/root/etc/php.d/fileinfo.ini, fileinfo fileinfo support => enabled
Available PHP Extensions
Below is a list of PHP extensions for PHP 8. Available extensions will vary depending on your installed PHP version(s).
- build – package shipping basic build configuration
- libc-client – UW C-client mail library
- libc-client-devel – development tools for programs which will use the UW IMAP library
- libc-client-static – UW IMAP static library
- pear – PHP Extension and Application Repository framework
- php – PHP DSO
- php-bcmath – module for PHP applications for using the bcmath library
- php-bz2 – module for PHP applications that interface with .bz2 files
- php-calendar – module for PHP applications that need date/time calculations
- php-cli – CLI for PHP
- php-common – common files for PHP
- php-curl – module for PHP applications that need to interface with curl
- php-dba – database abstraction layer module for PHP applications
- php-dbg – interactive PHP debugger
- php-devel – files needed for building PHP extensions
- php-enchant – Enchant spelling extension for PHP applications
- php-exif – module for PHP applications that need to work with image metadata
- php-fileinfo – module for PHP applications that need to detect file types
- php-fpm – PHP FastCGI Process Manager
- php-ftp – module for PHP applications that need full FTP protocol support
- php-gd – module for PHP applications for using the gd graphics library
- php-gettext – module for PHP applications that need native language support
- php-gmp – module for PHP applications for using the GNU MP library
- php-iconv – module for PHP applications that need to convert character sets
- php-imagick – native php extension to create and modify images using the ImageMagick API
- php-imap – module for PHP applications that use IMAP
- php-intl – internationalization extension for PHP applications
- php-ldap – module for PHP applications that use LDAP
- php-libsodium – modern, easy-to-use software library for encryption, decryption, signatures, password hashing and more. Its goal is to provide all of the core operations needed to build higher-level cryptographic tools
- php-litespeed – LiteSpeed web server PHP support
- php-mbstring – module for PHP applications which need multi-byte string handling
- php-memcached – php-memcached extension for ea-php80
- php-mysqlnd – module for PHP applications that use MySQL databases
- php-odbc – module for PHP applications that use ODBC databases
- php-opcache – Zend OPcache
- php-pdo – database access abstraction module for PHP applications
- php-pgsql – PostgreSQL database module for PHP
- php-posix – modules for PHP scripts that need access to POSIX functions
- php-process – modules for PHP script using system process interfaces
- php-pspell – module for PHP applications for using pspell interfaces
- php-redis – PHP extension for interfacing with Redis
- php-snmp – module for PHP applications that query SNMP-managed devices
- php-soap – module for PHP applications that use the SOAP protocol
- php-sockets – module for PHP applications that need low-level access to sockets
- php-sodium – cryptographic extension based on Libsodium
- php-sourceguardian – loader for SourceGuardian-encoded PHP files
- php-tidy – standard PHP module provides tidy library support
- php-xml – module for PHP applications which use XML
- php-zip – module for PHP applications that need to handle .zip files
- runtime – package that handles ea-php80 Software Collection
- scldevel – package shipping development files for ea-php80
You can view the documented PHP extensions list at PHP.net.
Now that you know how to install a PHP extension using EasyApache 4, you can continue to customize your server’s Apache/PHP environment. Installing other PHP extensions and Apache modules is generally done by following the same process. Be sure to check out our EasyApache Education Channel for more advanced guides.