如何安装 php5-mcrypt

Ahm*_*mad 4 lamp php apt apache2

当我尝试使用sudo apt-get install php5-mcrypt安装 php5-mcrypt 时,收到以下错误。我曾经sudo apt-get install lamp-server^安装过php5

ahmad@ubuntu:/var/www/html$ sudo apt-get install php5-mcrypt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5-mcrypt is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php5-mcrypt' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

kar*_*rel 7

php5-mcrypt(用于 php5 的 MCrypt 模块)已在 Ubuntu 16.04、16.10 和 17.04 中更新为 php7.0-mcrypt(用于 PHP 的 libmcrypt 模块)。sudo apt-get install lamp-server^Ubuntu 16.04 中的命令在包列表文件中搜索所有Task:字段并使用lamp-server获取所有,其中包括 php7.0。然后它以标准方式安装这些包sudo apt-get install package1 package2...

在 Ubuntu 16.04 中打开终端并输入:

sudo apt-get install php7.0-mcrypt  
Run Code Online (Sandbox Code Playgroud)

在 Ubuntu 17.10 和 18.04 中,php5-mcrypt 已更新为 php7.1-mcrypt。