提供:あわWiki
移動先: 案内検索

ヘルプ:PHPからImageMagickを使う(AlmaLinux)

メインページ > ヘルプ:目次 > ヘルプ:自宅サーバー構築(AlmaLinux)  > PHPからImageMagickを使う(AlmaLinux)

PHPでImagickを使えるようにする

[root@host4 ~]# dnf --enablerepo=epel install ImageMagick

[root@host4 ~]# dnf --enablerepo=epel install ImageMagick-devel

[root@host4 ~]# dnf -y install php-devel ← peclでphpizeが使えなかったため

[root@host4 ~]# dnf --enablerepo=epel install ImageMagick-perl ← PerlMagickのインストール

[root@host4 ~]# pecl install imagick
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini

[root@host4 ~]# find / -name imagick.so
/usr/lib64/php/modules/imagick.so

[root@host4 ~]# vi /etc/php.d/imagick.ini
; Enable imagick extension module
extension=imagick.so

php-fpmの再起動

[root@host4 ~]# systemctl restart php-fpm

Webサーバー再起動

[root@host4 ~]# systemctl restart httpd

phpinfoでimagickを使えるかどうかを確認

Phpinfo-imagick.png