5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pecl install imagick がエラーになる場合の原因と対策

Last updated at Posted at 2019-12-12

やりたいこと

CakePHP3で

use Imagick;
new Imagick();

問題

yum install ImageMagick ImageMagick-devel

のあと、

pecl install imagick

がエラーになる。

対策

gccが無いことが原因であれば、下記を実行する。

yum -y install gcc

その後、

pecl install imagick

を再度実行する。

使えるようにするまで

pecl install imagick

が成功したら、

vi /etc/php.ini

で最下部に

extension=imagick.so

を追記して

chmod 755 /usr/lib64/php/modules/imagick.so
systemctl restart httpd

で、

new Imagick();

が動くようになればOK。

確認コマンド

php -r "echo phpinfo();" | grep "imagick"
imagick
imagick module => enabled
imagick module version => 3.4.4
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.skip_version_check => 0 => 0
5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?