Just today I signed up with Google Cloud Compute Engine. I did everything but then I stuck into an error while installing php5-mcrypt
extension.
Error:
root@instance-2:~# sudo apt-get install php5-mcrypt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php5-mcrypt : Depends: phpapi-20121212
Depends: php5-common (= 5.5.24+dfsg-1+deb.sury.org~vivid+1) but 5.6.4+dfsg-4ubuntu6 is to be installed
E: Unable to correct problems, you have held broken packages.
I searched everywhere and then I came here. Please help.
Also on Ubuntu, make sure you actually have php5-mcrypt installed. You can install it with: Using PHP version "PHP Version 5.3.10-1ubuntu3.4" and Ubuntu 12.0.4 on Apache2... Make sure you have mcrypt installed and active on your php5 install. Use "sudo apt-get install php5-mcrypt" to install, that should sort the issue.
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 The mcrypt extension was moved to the PECL repository and is no longer bundled with PHP as of PHP 7.2.0.
The command sudo apt-get install lamp-server^ in Ubuntu 16.04 searches the package list files for all Task: fields and gets all with lamp-server, among them is php7.0. Then it installs those packages the standard way with sudo apt-get install package1 package2...
The mcrypt extension was moved to the PECL repository and is no longer bundled with PHP as of PHP 7.2.0. PECL is a repository for all known PHP extensions where users can download and host developed PHP extensions. Tell your OS to pull the latest list of packages available in repositories for installation:
sudo service apache2 restar
apt-get install php5-common
Or, if you dont need to keep configurations:
apt-get purge php5-common
apt-get install php5-common
Do you get any output from apt-mark showhold
?
If it does not solve your problem, you should try install it with aptitude:
sudo apt-get install aptitude
sudo aptitude install php5-mcrypt
Finally reatast the server
sudo service apache2 restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With