duanbarong4321 2019-07-30 21:24
浏览 469
已采纳

如何在当前启用的PHP版本中安装imagick?

I have multiple PHP version installed (7.0, 7.1 and 7.3). I have enabled PHP 7.0 (I need to keep this version for various reasons). When I try to install imagick (via sudo apt-get install php-imagick) the libraries are copied/installed only for PHP 7.3, despite I'm using 7.0 as confirmed by php -v and phpinfo file.

Am I missing any Apache setting? Why it doesn't consider the current 7.0 enabled module as default php version while installing new php libraries?

OS: Debian 10 WS: Apache/2.4.38

I've tried to edit php.ini, enable extensions, usual basic procedure... but imagick.so is compiled for php 7.3 only. There's no trace of them in the extension folder of PHP 7.0 and it's not possible to load it.

UPDATE #1

Checking with sudo update-alternatives --config php
I see this table (see image) - I don't know how to change priority or automode. It looks like PHP 7.3 keep the top priority.


screen

UPDATE #2

Tried this, no results.

PHP 7.0 set as default
sudo update-alternatives --set php /usr/bin/php7.0 sudo update-alternatives --set php-config /usr/bin/php-config7.0 sudo update-alternatives --set phpize /usr/bin/phpize7.0

Reinstall imagick

sudo apt-get install imagemagick php-imagick --reinstall
(no error, but it keeps installing them for PHP 7.3)
php -m show no modules, because they are in the extension folder of php 7.3

  • 写回答

1条回答 默认 最新

  • duanmei1694 2019-07-30 21:59
    关注

    Debian 10 uses PHP 7.3 as its "standard" PHP version, so all of its PHP extension packages -- including php-imagick -- will contain extensions which target PHP 7.3.

    If you have somehow installed PHP 7.0 (which you should not do, as it reached end-of-life in January 2019 and no longer receives security updates), you will need to obtain extensions for it through some other channel.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵