Unable to install PHP zip archive with PHP 7.2 - php

I am running into some issues installing the PHP zip archive and not sure how to fix this. I am running Ubuntu 18 with PHP 7.2
The error I receive in terminal is
The following packages have unmet dependencies.
php7.2-zip : Depends: php7.2-common (= 7.2.5-0ubuntu0.18.04.1) but 7.2.5-
1+ubuntu17.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
Any help would be appreciated, thanks

I tried changing the repository list with:
http://security.ubuntu.com/ubuntu bionic-security main universe
http://archive.ubuntu.com/ubuntu bionic main restricted universe
But none of them seem to work, but I finally found a repository that works running the following command
add-apt-repository ppa:ondrej/php
And then updating and installing normally the package using apt-get
php7.2-zip Installed
As you can see its installed at last.

On Ubuntu 18.04, this can happen if your missing the "security.ubuntu.com/ubuntu bionic-security main universe" repo.
Add it to your /etc/apt/sources.list, update and then it will install normally.
echo "deb http://security.ubuntu.com/ubuntu bionic-security main universe" >>
/etc/apt/sources.list
apt update
apt install php7.2-zip

Related

Can not install php7.4-soap on Debian 9

I am using Debian 9, and I recently upgraded PHP from 5.6 to 7.4. I was hit by the
Class 'SoapClient' not found
error when running an old PHP script, which worked very well under PHP 5.6. The phpinfo() lists "SOAP" module but it doesn't have a dedicated "soap" section with "Soap Client" listed (as mentioned here).
I believe the problem is that I have not installed the php7.4-soap extension, so I run sudo apt-get install php7.4-soap, but I got these errors:
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.4-soap : Depends: php7.4-common (= 7.4.20-1+ubuntu21.04.1+deb.sury.org+1) but 7.4.16-1+0~20210305.42+debian9~1.gbpbbe65e is to be installed
Depends: libc6 (>= 2.33) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried installing php7.4-common manually, but the installation failed with these errors:
php7.4-common : Depends: libc6 (>= 2.33) but 2.24-11+deb9u4 is to be installed
Depends: libffi8ubuntu1 (>= 3.4~20200819) but it is not installable
E: Unable to correct problems, you have held broken packages.
How can I resolve this kind of problem? Thank you.
My output of grep -Rn --include=\*.list ^[^\#] /etc/apt/ is:
/etc/apt/sources.list.d/mysql.list:4:deb http://repo.mysql.com/apt/debian/ stretch mysql-apt-config
/etc/apt/sources.list.d/mysql.list:5:deb http://repo.mysql.com/apt/debian/ stretch mysql-5.6
/etc/apt/sources.list.d/mysql.list:6:deb http://repo.mysql.com/apt/debian/ stretch mysql-tools
/etc/apt/sources.list.d/mysql.list:8:deb-src http://repo.mysql.com/apt/debian/ stretch mysql-5.6
/etc/apt/sources.list.d/dotdeb.list:1:deb http://packages.dotdeb.org wheezy-php56 all
/etc/apt/sources.list.d/dotdeb.list:2:deb-src http://packages.dotdeb.org wheezy-php56 all
/etc/apt/sources.list.d/php.list:1:deb https://packages.sury.org/php/ stretch main
/etc/apt/sources.list:17:deb http://mirrors.linode.com/debian stretch main
/etc/apt/sources.list:18:deb-src http://mirrors.linode.com/debian stretch main
/etc/apt/sources.list:20:deb http://mirrors.linode.com/debian-security/ stretch/updates main
/etc/apt/sources.list:21:deb-src http://mirrors.linode.com/debian-security/ stretch/updates main
/etc/apt/sources.list:24:deb http://mirrors.linode.com/debian stretch-updates main
/etc/apt/sources.list:25:deb-src http://mirrors.linode.com/debian stretch-updates main
On debian the php7.4-soap is available for bullseye and sid.
On debian Stretch, you can install php7.4-soap from Sury repo:
sudo apt install apt-transport-https software-properties-common lsb-release ca-certificates
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" sudo tee /etc/apt/sources.list.d/php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
sudo apt update
sudo apt install php7.4-soap

APT says 'package has no installation candidate' althought it shows it in apt list

I am trying to install ZeroMQ extension for PHP using Docker image php:7.4-apache-buster.
The package is found when running apt list:
$ sudo apt update && apt list php-zmq outputs php-zmq/stable 1.1.3-9 amd64
It is not possible to install it however:
$ sudo apt install php-zmq outputs E: Package 'php-zmq' has no installation candidate
I have checked that the package is not already installed using apt list --installed php-zmq. Underlying libzmq5 library is present on the system.
I wonder how does apt list command work that it suggests packages which apt install is unable to install.
Thanks for any help.
The package php-zmq is available in debian main repository , you need to edit your sources as follows:
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main
Edit
Manual install:
sudo apt install gdebi
wget http://ftp.us.debian.org/debian/pool/main/p/php-defaults/php-common_69_all.deb
wget http://ftp.us.debian.org/debian/pool/main/p/php-zmq/php-zmq_1.1.3-9_amd64.deb
sudo gdebi php-common_69_all.deb
sudo gdebi php-zmq_1.1.3-9_amd64.deb

How to install php-5.6 imagick on Debian 10

Is that possible to install php5.6-imagick on Debian 10? I installed debian 10 and moved my old codebase in it, but site not working with php7 so I have figured out how to install php5.6, but when I'm trying to install php5.6-imagick I've got this error:
The following packages have unmet dependencies:
php5.6-imagick : Depends: libmagickcore-6.q16-3 (>= 8:6.9.6.8) but it is not installable
Depends: libmagickwand-6.q16-3 (>= 8:6.9.6.8) but it is not installable
Recommends: ghostscript but it is not going to be installed
Recommends: ttf-dejavu-core but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Output of this: grep -Rn --include=\*.list ^[^\#] /etc/apt/
/etc/apt/sources.list.d/php.list:1:deb https://packages.sury.org/php/ stretch main
/etc/apt/sources.list.d/ondrej-ubuntu-php-hirsute.list:1:deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main
/etc/apt/sources.list:7:deb http://deb.debian.org/debian/ buster main
/etc/apt/sources.list:8:deb-src http://deb.debian.org/debian/ buster main
/etc/apt/sources.list:10:deb http://security.debian.org/debian-security buster/updates main
/etc/apt/sources.list:11:deb-src http://security.debian.org/debian-security buster/updates main
/etc/apt/sources.list:14:deb http://deb.debian.org/debian/ buster-updates main
/etc/apt/sources.list:15:deb-src http://deb.debian.org/debian/ buster-updates main
Remove ondrej-ubuntu-php-hirsute.list it is for Ubuntu hirsute:
sudo rm /etc/apt/sources.list.d/ondrej-ubuntu-php-hirsute.list
Use buster codename instead of stretch in Sury repository:
sudo sed -i 's/stretch/buster/' /etc/apt/sources.list.d/php.list
Then run :
sudo apt update
sudo apt install php5.6-imagick

Debian 8 Jessie and PHP > 7.2

I recently restored my personal test server with a completely fresh install of Debian 8.
The Service Provider where I purchased the Virtual Server, has only the Debian 8 option. So there is currently no possibility to upgrade to stretch or buster (9 and 10).
I need to install at least PHP 7.2 on my server to meet the requirements for the project and I'm having a hard time accomplishing that. As www.dotdeb.org seems to be discontinued I am wondering what package source I should add for PHP 7.2. All I found googling around was when dotdeb was still providing 7.2 packages.
My sources.list looks like this:
deb http://debian.mirror.serverloft.de/debian/ jessie main contrib non-free
deb http://debian.mirror.serverloft.de/debian-security/ jessie/updates main contrib non-free
deb http://packages.dotdeb.org jessie all
deb https://packages.sury.org/php/ jessie main
deb-src http://packages.dotdeb.org jessie all
but when I do
apt-get uptate
apt-get install php 7.2
I get
E: Unable to locate package php7.2
E: Couldn't find any package by regex 'php7.2'
Maybe there is no such option anymore and I have to change the provider to get a higher Debian version?
You can install the php 7.2 or later in debian jessie. But you need to follow some steps for getting this. The main reason is debian platform has been stopped the sury package service for jessie. Please check this link https://packages.sury.org/php/dists/
Now you know, it's not have the jessie support.
Okay Now we start the process of php 7.2 installation
Open /etc/apt/sources.list and add deb http://ftp.de.debian.org/debian stretch main.
It helps to get the stretch repos for the supporting dependencies of php 7.2
$ sudo apt update
$ sudo nano /etc/apt/sources.list.d/php.list.
then add deb https://packages.sury.org/php/ stretch main. this is also a stretch repo
$ sudo apt update
Now the php needs the updation of libncurses5 >= 6
check the current available version of libncurses5
$ sudo apt search libncurses5 //it shows you the libncurses5 as 6.0
$ sudo apt install libncurses5
$ sudo apt-get install php7.2 php7.2-readline php7.2-cli php7.2-fpm
$ sudo apt install php7.2-common php7.2-mysql php7.2-xml php7.2-xmlrpc php7.2-curl php7.2-gd php7.2-imagick php7.2-dev php7.2-imap php7.2-mbstring php7.2-opcache php7.2-soap php7.2-zip php7.2-intl -y
check unix socket is found in /var/run/php
Now you found php7.2-fpm.sock in this directory
Last step. just start the php service: $ sudo service php7.2-fpm start
Now you check the status and version of php $ sudo service php7.2-fpm status && $ php -v
Hurray. you got the newest version of php. Thanks a lot
Note: Don't forget to stop the previous service for php in your machine
I've got PHP 8.0 from this all-in-one bundle: https://bitnami.com/stack/lapp/installer
It does not depend on Linux distro

Cannot install php7.0-fpm via ppa:ondrej/php

I have been installing php7.0-fpm via ppa:ondrej/php on Ubuntu using the following commands without issue over the last few months whilst preparing my new server;
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.0-fpm
Today, I tried to install again using the same commands as above, and now I get a failure with the final command as follows;
root#10:/etc/apt/sources.list.d# apt-get install php7.0-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-fpm
E: Couldn't find any package by regex 'php7.0-fpm'
Any clues as to why this install command set has suddenly stopped working?!
The same error is recorded when trying to install php7.0-mysql, which again was working fine until recently.
Many thanks in advance,
Dave
I have found a resolution for this as shown below.
The Ubuntu version I was using was 15.04, which is now out of support.
After upgrading my install to Ubuntu 15.10 the installation of php7.0-fpm and php7.0-mysql work as expected.
It appears that the php7.0-* packages have been removed from the Ubuntu 15.04 version of the ppa:ondrej/php repo, but are available in the 15.10 version.
Currently upgrading all my servers based on this change.
Dave
The dotdeb repository seems to be working with the 7.0 extensions for me:
https://www.dotdeb.org/instructions/
It's probably not ideal, but:
"Depending on your distribution (Jessie, Wheezy or Squeeze), add these two lines to your /etc/apt/sources.list file (you can also choose a mirror near you) :"
deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all
Then you should be able to install everything with:
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv

Categories