2016年08月14日
Tweet
ImageMagick をインストールするには、コンパイルなどをする必要があるため、PECLが必要だということです。
そのため以下の方法でインストール
# yum install php-pear
#pecl install imagick
エラーになる。。。。PHPのバージョンで怒られました。
# pecl install imagick-3.1.2
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
.....................done: 94,657 bytes
15 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize' failed
※phpize が無いと言うことでエラー。
# yum -y install php-devel
#pecl install imagick-3.1.2
downloading imagick-3.1.2.tgz ...
- 中略 -
ERROR: `/var/tmp/imagick/configure --with-imagick' failed
devel もインストールする必要があるようです。
# yum -y install ImageMagick-devel
# pecl install imagick-3.1.2
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
- 中略 -
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
これでOKです。あとは ini ファイルの書き換え。
念のためファイル確認
ls /usr/lib64/php/modules/imagick.so
#vi /etc/php.d/imagick.ini
extension=imagick.so
サービス再起動
#service httpd reload
モジュールの確認
#php -m |grep imagick
phpinfo からも確認できました。

そのため以下の方法でインストール
# yum install php-pear
#pecl install imagick
エラーになる。。。。PHPのバージョンで怒られました。
# pecl install imagick-3.1.2
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
.....................done: 94,657 bytes
15 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize' failed
※phpize が無いと言うことでエラー。
# yum -y install php-devel
#pecl install imagick-3.1.2
downloading imagick-3.1.2.tgz ...
- 中略 -
ERROR: `/var/tmp/imagick/configure --with-imagick' failed
devel もインストールする必要があるようです。
# yum -y install ImageMagick-devel
# pecl install imagick-3.1.2
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
- 中略 -
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
これでOKです。あとは ini ファイルの書き換え。
念のためファイル確認
ls /usr/lib64/php/modules/imagick.so
#vi /etc/php.d/imagick.ini
extension=imagick.so
サービス再起動
#service httpd reload
モジュールの確認
#php -m |grep imagick
phpinfo からも確認できました。