Install PHP Libraries on a CentOS

There are several ways to install PHP Libraries that your installation can utilize on a VPS or Dedicated server. Some of them are available via YUM and others could be installed using PHP PEAR or PECL. There are several famous PHP Libraries and we will their installation.

One thing to notice is that many of those libraries and extensions are available for multiple PHP versions on any Shared Hosting Package that you can have with us, they’re available through:

cPanel -> Select PHP Version -> Select Extensions -> Save

Install PHP Libraries on a CentOS VPS or Dedicated Server

To start off we’ll need PEAR and PECL’s functionality, you can install it using the following line after you’ve logged to your VPS or Dedicated server via SSH:

Install PEAR and PECL

yum install php-pear

Install php-gd

yum install php-gd

Install imagemagick

pecl install imagick

After this, we’ll need to configure php.ini to also utilize imagick, let’s find out the location of php.ini

php -i | grep "Loaded Configuration File =>"

Then append the imagick extension at the bottom:

echo "extension=imagick.so" >> /location/to/php.ini

Install PHP Packages with PEAR

You can look up any desired extension from their official repository at https://pecl.php.net/packages.php after that simply run the command:

pecl install desiredExtension

Do not forget to add the installed extension in your php.ini in the same way as above

echo "extension=newlyInstalled.so" >> /location/to/php.ini
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

CentOS Web Panel Installation – Step by step Guide

In this article, we will show you how to make a working CentOS Web Panel Installation. To avoid...

CentOS Web Panel Review – Introduction

CentOS Web Panel is a hosting control panel which centres around easy and quick management of...

Install Python’s PIP on a CentOS Server

PIP is Python’s Package Manager, with it you can easily install libraries and additional Python...

Install Python’s PIP on a Debian Server

If you’re using a Debian server that’s hosting a Python application you might need to have...

How to install FFmpeg on your VPS / Dedicated Server

In this tutorial we will show you how to install FFmpeg on your VPS/dedicated server running on...