0

I have installed imagick extension for php by command: pecl install imagick After that, I restart httpd and restart php-fpm.

I checked imagick loaded in php command line but when use phpinfo() for show in httpd, imagick extension was not loaded.

I have already check the file php.ini in command line and php.ini in httpd was loaded the same location.

This error in amazon server. Any help me check the error? Sorry for my bad english.

0

1 Answer 1

0

1. Install required packages

yum install php-pear php-devel gcc

2. Install ImageMagick

yum install ImageMagick
yum install ImageMagick-devel

3. Install ImageMagick PHP Extension

pecl install imagick
echo "extension=imagick.so" > /etc/php.d/imagick.ini

-- OR

Enable remi repository for centos using below guide.

https://www.ubuntumint.com/install-remi-repo-in-rhel-centos-rocky-almalinux/

Once remi repository enabled, you can directly install it from repository using yum.

yum install php-pecl-imagick

4. Restart Apache and check the installation

service httpd restart
4
  • Thanks for your reply @Vaibhav . I already install ImageMagick at step 2 via build from source. And already did step 3. After check php -i in command line, module imagick is loaded. But run phpinfo() via httpd, imagick extension is not loaded.
    – RyanLe
    Commented Mar 2 at 8:31
  • I have to install ImageMagick from source to support handle heif image format.
    – RyanLe
    Commented Mar 2 at 8:34
  • if you have multiple php versions install on server, it may possible that php loaded in apache and default command line php is different. So make sure both are using same php version. Commented Mar 2 at 9:39
  • There is only php 8.1 installed. and php cli and php-fpm running in httpd is loading php.ini in the same location (/etc/php.ini)
    – RyanLe
    Commented Mar 2 at 9:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .