Knowledgebase

How to Install ImageMagick for EA-PHP

To install ImageMagick for EA-PHP (cPanel's EasyApache PHP), follow these steps:

  1. SSH into Your Server:

    Connect to your server via SSH using a terminal or an SSH client like PuTTY.

  2. Update the System:

    Before installing any new packages, it's a good idea to update the system's package list:

    bash

 

  • sudo yum update
  • Install ImageMagick:

    You can install ImageMagick and the PHP extension using the following command:

    bash
  • sudo yum install ImageMagick ImageMagick-devel ea-php<version>-php-pecl-imagick

    Replace <version> with the specific version of PHP you are using (e.g., ea-php74-php-pecl-imagick for PHP 7.4).

  • Verify the Installation:

    After the installation is complete, you can verify if ImageMagick is installed and working by using the following command:

    bash
  • php -m | grep imagick

    If installed correctly, "imagick" should appear in the list of loaded PHP modules.

  • Restart Apache:

    To apply the changes, you'll need to restart the Apache web server:

    bash
  • sudo systemctl restart httpd
  • Check Configuration in PHP Info:

    Create a PHP info file to verify that the ImageMagick extension is loaded and configured correctly:

    bash

 

  1. echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php

    Then, access http://your_domain_or_IP/phpinfo.php in a web browser. Search for "imagick" to ensure it appears in the PHP configuration.

Please note that the specific steps may vary slightly based on your server's configuration. Always ensure you have backups of your data and configuration files before making any significant changes.

Additionally, keep in mind that if you're using a custom PHP version or a different package manager, the commands might be different.

  • 0 Users Found This Useful
Was this answer helpful?