How to install php-5.6 imagick on Debian 10 - php

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

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

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

Unable to install PHP zip archive with PHP 7.2

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

Need to install php5.4 on ubuntu 12.04 LTS precise

I am using following instruction to install latest php on unbutu instance:
Add to /etc/apt/source.list
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
Update apt-key
sudo wget -q http://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
sudo apt-get update
install apache2 + php
`sudo apt-get install -y apache2 php5 libapache2-mod-php5`
Output:
The following packages have unmet dependencies:
libapache2-mod-php5 : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4 is to be installed
Recommends: php5-cli but it is not going to be installed
I need a stable way to install latest php. Previously I was using ppa and decided to not use it bcz of security
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5-oldstable
I wonder if there is a better way to setup latest php+apache2+mysql , I have to script the process to automate the installation and invoke it through build script
Side note/problem background:
I am using Phing ssh task to invoke the script to setup php+apache2+mysql, which break with add-apt-repository command for weird reason
Reference:
<ssh host="${deploy.host}"
username="${deploy.user}"
privkeyfile="${deploy.pem}"
pubkeyfile="${deploy.pub}"
command="${ssh_command}"
display="false"
property="ssh.output"
failonerror="true"
/>
ssh_command where I invoke the script
Further tests:
sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-gd php5-memcache php5-mcrypt php5-xsl
Output:
The following packages have unmet dependencies:
libapache2-mod-php5 : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4 is to be installed
php5-cli : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4 is to be installed
Depends: libedit2 (>= 2.11-20080614-4) but 2.11-20080614-3ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
I had a similar situation.
The place where I was working was using an old version on PHP (5.3.8).
I installed the latest version of Ubuntu in my desktop and then I realised that downgrading from 5.5 to 5.3 was almost impossible, too many dependencies to handle, the best solution I could find was to use an "all-in-one" package like XAMPP.
Even though I hate those solutions I changed my mind after a couple of hours, it did exactly what it was supposed to do, I didn't have to do any sorcery in the package manager or alter any configuration files.
Here is the XAMPP version I would use in your case (1.8.2-3 version - PHP 5.4 based)
It contains
PHP 5.4.22
MySQL 5.5.34
Apache 2.4.7
phpMyAdmin 4.0.9
More info: here and here

Categories