UbuntuServer18.04LTS中缺少php-mcrypt包吗?
apt install php-mcrypt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-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 'php-mcrypt' has no installation candidate发布于 2018-05-17 13:45:27
在PHP7.2中,Mcrypt已被废弃,因此默认情况下它不可用。
您仍然可以使用pecl安装mcrypt扩展。这些说明是针对apache web服务器的。
# Install prerequisites
sudo apt-get install php-dev libmcrypt-dev gcc make autoconf libc-dev pkg-config
# Compile mcrypt extension
sudo pecl install mcrypt-1.0.1
# Just press enter when it asks about libmcrypt prefix
# Enable extension for apache
echo "extension=mcrypt.so" | sudo tee -a /etc/php/7.2/apache2/conf.d/mcrypt.ini
# Restart apache
sudo service apache2 restart那应该能让你走了。
从长远来看,您可能希望取代mcrypt,这是有原因的。
发布于 2018-05-05 18:37:39
我做了下面的工作.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.1-mcrypt如果运行php5.6或7.0,则可以使用以下方法
sudo apt-get install php5.6-mcrypt
sudo apt-get install php7.0-mcrypt发布于 2018-05-16 04:10:27
php已在php7.2 http://php.net/manual/en/migration71.deprecated.php中被删除。
https://askubuntu.com/questions/1031921
复制相似问题