Ubuntu 22 無法用 apt 安裝 php8.1-mcrypt & libmcrypt

先查詢是否已安裝 mcrypt

# php -m | grep mcrypt


安裝 php-mcrypt 套件

# apt install php8.1-mcrypt


會出現以下的錯誤訊息

php8.1-mcrypt : Depends: libmcrypt4 (>= 2.5.8) but it is not installable


有看到資料說 mcrypt 於 php 7.2 後以移到 pecl 中

所以也嘗試用 pecl 安裝 mcrypt

# pecl install mcrypt

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

ERROR: `/tmp/pear/temp/mcrypt/configure --with-php-config=/usr/bin/php-config --with-mcrypt' failed

也是失敗


後來到這邊直接下載 .deb 安裝

下載完後安裝

# dpkg -i libmcrypt4_2.5.8-7_amd64.deb


安裝完再用第一個指令確認一下


我的環境:

  • Ubuntu 22.04
  • PHP 8.1.11

Comments

Popular posts from this blog

CentOS7 如何新增/移除 Rich Rule for firewalld

mac 安裝 mtr

Howto use Postman test Cors