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

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

Related

Call to undefined function curl_init() - Ubuntu 16.04

For your reference, please:
OS: Ubuntu 16.04
PHP: PHP 7.2.34
NGIX: nginx/1.10.3 (Ubuntu)
I'm having a problem installing php curl. I already tried commands I found online but still, no luck.
Any help would be appreciated. Thank you in advance :)
I already tried these commands:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.2-curl
But I always have this result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'
E: Couldn't find any package by regex 'php7.2-curl'
When I try this command:
sudo apt-get update
sudo apt install php-curl
This is the result:
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-curl : Depends: php7.0-curl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Can't install php7.2-ldap on Ubuntu 18.10 - "unmet dependencies"

Recently I'm working with Laravel and LDAP (Active directory) authentication. But I can't install php7.2-ldap, I also tried to install in php7.3 but failed.
Currently I'm using ubuntu v18.10 with multiple php version.
I tried:
$ sudo apt-get install php7.2-ldap
and got this output
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-ldap : Depends: php7.2-common (= 7.2.19-0ubuntu0.18.10.1) but 7.2.20-1+ubuntu18.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried $ sudo apt-get update and upgrade also before do it.
7.2.20-1+ubuntu18.10.1+deb.sury.org+1 is to be installed
deb.sury.org refers to Ondřej Surý PPA, you need to reinstall php following these steps :
You need to have the software-properties-common package installed :
sudo apt-get install software-properties-common
Add the ondrej PPA repo and update sources :
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
Install php and needed extensions :
sudo apt-get install php7.2-common php7.2-ldap
how to : https://pixelspress.com/how-to-install-php-7-2-on-ubuntu-16-04-18-04-18-10/

php7.1-zip installation under Ubuntu 18.04

as the title already explains I need to install the zip module from php 7.1 under Ubuntu 18.04. When every I use the command
sudo apt-get install php7.1-zip
and the follwing output.
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.1-zip : Depends: libzip4 (>= 1.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
Trying to Install libzip4 does not work either.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libzip4 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 'libzip4' has no installation candidate
Can somebody please try to help. Google does not help with unfortunately either.
Elias
Use the official repository:
sudo add-apt-repository universe
sudo apt update
then:
sudo apt install php7.1-zip
A temporary solution is to just download the package file from trusted source like:
https://packages.ubuntu.com/xenial/libzip4
Afterwards, install it with
dpkg -i libzip4_1.0.1-0ubuntu1_amd64.deb
And the php7.1-zip will install gracefully.
Please try with the following:
if you are using 64-bit then do:
sudo apt-get purge libzip4
then:
sudo apt-get install php7.1-zip
if you are using 32-bit system then:
sudo apt-get install php7.1-zip:i386

Cannot install php 7.2 on Raspbian

I cannot install php 7.2 on Raspbian.
I used the last Raspbian (Release date : 2017-11-29) with a Debian Stretch 9.1 : https://www.raspberrypi.org/downloads/raspbian/
I followed the instructions from https://www.colinodell.com/blog/2016-12/installing-php-7-1 :
apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
But when I try
apt-get install -y php7.2
A get the below errors :
root#raspberrypi:/home/pi# apt-get install -y php7.2
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 installable or
php7.2-fpm but it is not installable or
php7.2-cgi but it is not installable
Depends: php7.2-common but it is not installable
E: Unable to correct problems, you have held broken packages.
Someone can help me ?
Thanks a lot
I found the reason, the package php7.1 and php7.2 isn't in the stretch repo :(.
https://raspberrypi.stackexchange.com/questions/70388/how-to-install-php-7-1
Have to wait an update ...
Please check this GitHub issue:
https://github.com/oerdnj/deb.sury.org/issues/579
It seems that Debian packages for newer PHP versions are not yet released for the ARM architecture.
I would like to contribute for building such packages, but there is no activity on the issue after my last post.
An option to install PHP7.1 or newer would be to compile and install it yourself. For some examples, you may want to check http://yoestuve.es/blog/compile-php-7-for-raspberry-pi-with-memcached/. I would also suggest to use checkinstall instead of make install in order to facilitate easier uninstallation later.
Unfortunately it does not look like there will be a higher version than PHP 7.0 for raspberrys with stretch. Here you can see the PHP versions for current and future raspbian releases:
https://packages.debian.org/search?arch=armhf&searchon=names&keywords=php
You will have to upgrade to buster, then you will get PHP 7.3. Here is how:
https://www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/

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.

Categories