요즘 대부분의 php extension들은 yum으로 설치가 됩니다.
하지만 테스트용으로 PHP 5.6을 구동하는 서버에서 애를 먹었던 기억때문에 기록을 남깁니다.
[root@localhost ~]# yum install --enablerepo=remi php56-php-pecl-imagick php56-php-pecl-imagick-devel Loaded plugins: fastestmirror, langpacks, replace Loading mirror speeds from cached hostfile * base: mirror.kakao.com * epel: mirror.premi.st * extras: mirror.kakao.com * remi: ftp.riken.jp * remi-safe: ftp.riken.jp * updates: mirror.kakao.com * webtatic: us-east.repo.webtatic.com Resolving Dependencies --> Running transaction check ---> Package php56-php-pecl-imagick.x86_64 0:3.4.3-9.el7.remi will be installed ---> Package php56-php-pecl-imagick-devel.x86_64 0:3.4.3-9.el7.remi will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================= Package Arch Version Repository Size ======================================================================================================================= Installing: php56-php-pecl-imagick x86_64 3.4.3-9.el7.remi remi 124 k php56-php-pecl-imagick-devel x86_64 3.4.3-9.el7.remi remi 96 k Transaction Summary ======================================================================================================================= Install 2 Packages Total download size: 220 k Installed size: 754 k Is this ok [y/d/N]: y Downloading packages: (1/2): php56-php-pecl-imagick-devel-3.4.3-9.el7.remi.x86_64.rpm | 96 kB 00:00:02 (2/2): php56-php-pecl-imagick-3.4.3-9.el7.remi.x86_64.rpm | 124 kB 00:00:16 ----------------------------------------------------------------------------------------------------------------------- Total 13 kB/s | 220 kB 00:00:16 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : php56-php-pecl-imagick-3.4.3-9.el7.remi.x86_64 1/2 Installing : php56-php-pecl-imagick-devel-3.4.3-9.el7.remi.x86_64 2/2 Verifying : php56-php-pecl-imagick-3.4.3-9.el7.remi.x86_64 1/2 Verifying : php56-php-pecl-imagick-devel-3.4.3-9.el7.remi.x86_64 2/2 Installed: php56-php-pecl-imagick.x86_64 0:3.4.3-9.el7.remi php56-php-pecl-imagick-devel.x86_64 0:3.4.3-9.el7.remi Complete!
설치가 끝났습니다.
아파치를 리스타트하고
[root@localhost ~]# systemctl restart httpd
php.ini를 확인해봐야 아무 변화가 없습니다.
[root@localhost ~]# vi /etc/php.ini
로
[imagick]
extension=imagick.so
를 추가했습니다.
[root@localhost ~]# systemctl restart httpd [root@localhost ~]# php -m | grep magick PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - /usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
역시 php.ini에도 변화가 없고 php -m | grep magick 해서 확인해보니 화일이 없답니다.
찾아보니 엉뚱한데 있기는 있네요.
[root@localhost ~]# find / -name imagick* /opt/remi/php56/root/usr/include/php/ext/imagick /opt/remi/php56/root/usr/lib64/php/modules/imagick.so /opt/remi/php56/root/usr/share/doc/pecl/imagick /opt/remi/php56/root/usr/share/tests/pecl/imagick ^C
해서 링크해서 다시 확인했습니다.
[root@localhost ~]# ln -s /opt/remi/php56/root/usr/lib64/php/modules/imagick.so /usr/lib64/php/modules/imagick.so [root@localhost ~]# systemctl restart httpd [root@localhost ~]# php -m | grep magick PHP Warning: Version warning: Imagick was compiled against Image Magick version 1689 but version 1690 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
ImageMagick하고 버전이 다르다고 메시지가 나오지만 동작하는데는 문제가 없는 것같습니다.
php.ini에도 잘 뜹니다.