Ali Cloud Linux3 : Installing ImageMagick for PHP 7.4

Step 1: If not already installed, install the php-devel and gcc packages.
$ sudo yum install php-devel gcc

To check if the packages are installed, use the following commands. If either command returns an empty result (or both do), you’ll need to install that package (or both).

$ sudo yum list installed | grep php-devel
$ which gcc

Step 2: Install the ImageMagick packages
$ sudo yum install ImageMagick ImageMagick-devel ImageMagick-perl

Step 3: Compile ImageMagick packages.
$ sudo pecl install imagick
if pecl not installed, run below command to get pecl.
$ sudo yum install php-pear

Step 4: Change the permissions on the compiled module.
$ sudo chmod 755 /usr/lib64/php/modules/imagick.so

Step 5: Add imagick to the libraries that are loaded when php starts.
$ cd /etc/php.d
$ sudo vim 20-imagick.ini

You can use either vim or nano to create and edit the 20-imagick.ini file. When the file opens, enter the following lines (first line is just a comment describing file purpose).

; Enable ImageMagick extension module
extension=imagick

Step 6: Restart the php service (php-fpm in my case), and then restart the web service.
$ sudo systemctl restart php-fpm
$ sudo systemctl restart httpd
If all goes well, you should have ImageMagick installed and running on your server in 5 minutes or less.


$php -m|grep imagick
imagick

 

posted on   遠離塵世の方舟  阅读(21)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
历史上的今天:
2015-01-30 VMware虚拟机与主机联通及配置上网
2015-01-30 Error in invoking target 'agent nmhs' of makefile
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示