在 CentOS 系统下配置 PHP-Imagick,你需要遵循以下步骤:
sudo yum install epel-release
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php74
请注意,你可能需要根据你的 CentOS 版本更改 remi-php74。例如,如果你使用的是 CentOS 8,你需要将其更改为 remi-php80。
sudo yum update php\*
sudo yum install php-imagick
sudo systemctl restart httpd
如果你使用的是 Nginx 和 PHP-FPM,请运行:
sudo systemctl restart nginx
sudo systemctl restart php-fpm
info.php 的文件,其中包含以下内容:<?php
phpinfo();
?>
将此文件放在你的 web 服务器文档根目录下,然后通过浏览器访问 http://your_server_ip/info.php。在显示的 PHP 信息页面中,搜索 “Imagick”,如果已成功安装,你应该能看到与 Imagick 相关的信息。
info.php 文件。