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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 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