ubuntu/debian下安裝php的imagick.so插件時,缺少libmagick++開發庫

字號+ 編輯: 国内TP粉 修訂: 种花家 來源: 2023-09-06 我要說兩句(0)

解決方法會佔很多硬磐資源。

php编译imagick插件的时候,有时候config阶段会报:

checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
checking Testing /opt/homebrew/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.

缺少magickwand的库,在ubuntu和debian系统中用以下命令安装

apt-get install libmagick++-dev

从pecl.php.net/packages/imagick下载源码包编译安装imagick.so

cd ~ && wget https://pecl.php.net/get/imagick-3.7.0.tgz 
tar zxvf imagick-3.7.0.tgz
cd imagick-3.7.0
phpize && ./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

完成后,如果出于节省硬盘空间的考虑,也轻易不要完全卸载libmagick的库,卸载完libmagickwand的库之后,php会提示因为基本库找不到,导致imagick.so无法加载。如果实在空间捉急,可以用以下方式:

apt autoremove libmagick++-dev
apt-get install libmagickwand-6.q16-6

这样只需要消耗130MB来代替600MB的开发库

閲完此文,您的感想如何?
  • 有用

    2

  • 沒用

    0

  • 開心

    0

  • 憤怒

    0

  • 可憐

    0

1.如文章侵犯了您的版權,請發郵件通知本站,該文章將在24小時内刪除;
2.本站標注原創的文章,轉發時煩請注明來源;
3.交流群: 2702237 13835667

相關課文
  • mac開發接入微信公衆號接口返回報錯 cURL error 56: SSLRead() return error -9806

  • PHP的換行符是什麽

  • pecl安裝程序時報錯Array and string offset access syntax with curly braces is no longer supported

  • 由於商家傳入的H5交易參數有誤,該筆交易暫時無法完成,請聯繫商家解決

我要說說
網上賓友點評