I ran apt-get dist-upgrade and my php stop working - php

I have searched but couldn't find a resource that helped, so I have to say it out loud. Please help me. I mistakenly ran sudo apt-get upgrade -u dist-upgrade
After that, all the websites on my server stopped working. I tried to check if Php is still installed by typing php -vbut I got
-bash: php: command not found
I also tried to reinstall php using
sudo apt-get install php
And I saw this
sudo apt-get install php
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:
php : Depends: php7.2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Then I tried running
Sudo apt-get install php7.2
And I saw this
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:
php7.2 : Depends: libapache2-mod-php7.2 but it is not going to be installed or
php7.2-fpm but it is not going to be installed or
php7.2-cgi but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I also tried installing the modules: and I get this:
root#matrixpluspluto:~# sudo apt-get install php7.2 php7.2-cli php7.2-c
gi php7.2-fpm libapache2-mod-php7.2 php7.2-opcache
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:
libapache2-mod-php7.2 : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-cgi : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-cli : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-fpm : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-opcache : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
E: Unable to correct problems, you have held broken packages.
I checked and saw that libc6 v2.24 is already installed
Please help me. Before this I was using php7.1 after the upgrade I started seeing 7.2. Anything I do concerning php doesn't work out. Pove been trying to fix this for more than 2 days, please help.

Don't know if you solved it yet but I had the same problem.
Solved it by running :
sudo apt-get purge php* .
Note that this is not a good solution but a desperate one. Also I knew what php related packages I had installed, so I wasen't afraid of what the command would purge.
Then I watched what packages are being purged and reintalled them.
Everything working fine for now.

Related

How to download php7.2-gd extension in ubuntu 21.04?

I want to install gd extension in my current php-project(php version is 7.2.34) for that i use this command sudo apt-get install php7.2-gd it's throwing following error and it's not showing in the list when i run php -m command ,How to install gd extension please help me to fix this issue..
Error
Reading package lists... Done
Building dependency tree... Done
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:
php7.2-gd : Depends: libjpeg62-turbo (>= 1.3.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
This package depends on libjpeg62-turbo so you need to install it first
wget http://ftp.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_amd64.deb
sudo apt-get install ./libjpeg62-turbo_1.5.1-2_amd64.deb
after that, you could install your package easily
sudo apt-get install php7.2-gd

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

I need help figuring out what's wrong. I want to install phpmyadmin on a server to import a wordpress DB but when I install it I have a problem with php-twig
I install phpmyadmin :
debian#XXX:~$ sudo apt-get install phpmyadmin
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:
phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed
E: Unable to correct problems, you have held broken packages.
So I install php-twig :
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-twig is already the newest version (2.6.2-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
How this two sentences can be true and at the same time ?
phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed
php-twig is already the newest version (2.6.2-2).
What I have missing ?
Thanks for your help
You have to use backports repository (https://wiki.debian.org/Backports):
aptitude -t buster-backports install php-twig
then, you can install phpmyadmin with:
apt install phpmyadmin
Installing from source is easier and more efficient. I use this tuto : https://www.digitalocean.com/community/tutorials/how-to-install-phpmyadmin-from-source-debian-10
I had the same issue, didn't find how to install php-twig 2.9, so I finally followed steps described here to install it from source : https://www.itzgeek.com/how-tos/linux/debian/how-to-install-phpmyadmin-with-nginx-on-debian-10.html

The following packages have unmet dependencies

I'm trying to install GMP on Ubuntu 14.04:
$ sudo apt-get install php5-gmp
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-gmp : Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.5) but 5.5.17+dfsg-2+deb.sury.org~precise+1 is to be installed
E: Unable to correct problems, you have held broken packages.
Why is it not letting me install this?
somehow you have installed a special version of php-common (= 5.5.17+dfsg-2+deb.sury.org~precise+1)
try to
apt-get remove php5-common
and then install again.
Your installation appears to be broken by php5-common-5.5.17+dfsg-2+deb.sury.org~precise+1 package installed from some alien repo.
Try to start with:
sudo apt-search php5
remove everything looking suspicious and then reinstall it from the official repo. I think, simple removal of this alien common and reinstalling gmp might resolve an issue.

Way to Install the MongoDB PHP Driver

I'm trying to enable PHP for Mongo DB. Solution for that is same (install php5-dev first) in every forums but to installation fails with error.
Any idea how to solve issue?
Note: Using Ubuntu 12:04
jojo#ubuntu:~$ sudo apt-get install php-pear php5-dev
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:
php-pear : Depends: php5-cli but it is not going to be installed
php5-dev : Depends: autoconf (>= 2.63) but it is not installable
Depends: automake (>= 1.11) but it is not installable
Depends: libtool (>= 2.2) but it is not installable
Depends: shtool but it is not installable
E: Unable to correct problems, you have held broken packages.
jojo#ubuntu:~$
Assuming you have already installed MongoDB, You can install PHP driver for MongoDB by this command
sudo apt-get install php5-mongo
sudo apt-get install php5-mongo
worked on PHP 5.5.9 / Ubuntu 14.04 LTS
I would suggest to do this:
apt-get update
apt-get upgrade
And then install:
apt-get install php5-cli php5-dev
And then:
apt-get install php-pear
pecl install mongo
I created a fresh content for sources.list using this page and then installed Synaptic Package Manager to install new stuff which solved the problem..
This seems less like an issue with installing php5-dev, or even the mongo extension, and more with the following conflicts:
Depends: autoconf (>= 2.63) but it is not installable
Depends: automake (>= 1.11) but it is not installable
Depends: libtool (>= 2.2) but it is not installable
Depends: shtool but it is not installable
You can get some more information on these with sudo aptitude show <package>, which may clue you in on other installed packages that they conflict with. From personal experience, I've only had to install the build-essential package to do any C/C++ compiling on Ubuntu. That high-level package usually ends up covering these dependencies.
http://docs.mongodb.org/ecosystem/drivers/php/
This link gives all commands we need to execute for different operting system to install php driver for mongoDb

How to upgrade libssl0.9.8 to install php5-fpm

I need to setup php on server where ROR and nginx are already configured .
When I am installing php5-fpm then there are one package libssl0.9.8 version dependency.
I have searched a lot and tried to remove and re-install package libssl0.9.8 but version is not updating .
I am getting below error when I am trying to install php5-fpm .
root#boxyroom:~# sudo apt-get install php5-fpm -f
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-fpm: Depends: libssl0.9.8 (>= 0.9.8m-1) but 0.9.8k-7ubuntu8.13 is to be installed
PreDepends: dpkg (>= 1.15.7.2) but 1.15.5.6ubuntu4.6 is to be installed
E: Broken packages
Please let me know if any one has an idea to install the php5-fpm or upgrading package libssl0.9.8.
Thanks in advance .

Categories