Unable to locate package php7.3-gd - php

I get the error from my cakephp 2.x project:
The PHP GD extension is required, but is not installed.
I use php7.3 with apache on debian
I search and find
apt-get install php7.3-gd
I tried this but i only get following error:
E: Unable to locate package php7.3-gd
E: Couldn't find any package by glob 'php7.3-gd'
E: Couldn't find any package by regex 'php7.3-gd'
I searched again, but didnt find a soulution for this problem only for ubunto and nothing else worked. I hope someone could help me with this problem.

It looks like you do not have the appropriate repo added. Try :
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.3-gd

#Will's answer did not work for me, I then replace the first command from sudo add-apt-repository ppa:ondrej/php to sudo apt-add-repository ppa:ondrej/php and it works for me. So finally I run:
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.3-gd

Related

cannot install php5.6-zip on ubuntu 16.04 [duplicate]

This question already has answers here:
Cannot add PPA: 'ppa:ondrej/php5-5.6'
(4 answers)
Closed 1 year ago.
currently I want to update my old php 5.6 application in ubuntu xenial 16.04.6 with php5.6-zip extension.
sudo apt-get install php5.6-zip
E: Unable to locate package php5.6-zip E: Couldn't find any package by glob 'php5.6-zip' E: Couldn't find any package by regex 'php5.6-zip'
tried to add the ppa repository sudo add-apt-repository -y ppa:ondrej/php5-5.6
The user named '~ondrej' has no PPA named 'ubuntu/php5-5.6'
Then tried to run sudo add-apt-repository -y ppa:ondrej/php and
sudo apt-get install php5.6-zip
still got the unable to locate package php5.6-zip error. Btw there is no php5.6-zip from apt-cache policy php5.6 command. Does anyone have solution regarding this problem? your help would be much appreciated. Thank you
As far as I know you can't install from zip using "apt-get install". Since the zip file contains the build files. To install it use this instead, this should work.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6
And this to see versions
php -v

can't install php 7.1

devall#giga:~$ sudo apt-get install php7.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1
E: Couldn't find any package by glob 'php7.1'
E: Couldn't find any package by regex 'php7.1'
I am trying to install php 7.1 , tried almost everything...
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
reinstalled ubuntu twice.. still same error. #help
try with software-properties-common
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt search php7
sudo apt install php7.1
php -v

curl and mbstring php 7.1 installation on ubuntu 17.04

I'm using php7.1 on Ubuntu 17.04, I have tried to install cURL using this command:
sudo apt-get install php-curl
but I get this:
Package 'php-curl' has no installation candidate
I tried also to specify the cURL version using:
sudo apt-get install php7.1-curl
but i got
E: Couldn't find any package by regex 'php7.1-curl
So, please, how do I install curl for PHP 7.1?
You need to add PHP ppa first, update, and install
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.1-curl
While it seems strange that you are not able to find php-curl, you should search for php curl package version available on your system:
sudo apt update
sudo apt search ^php
Between the results, it should display something like this (the output was taken from Ubuntu 17.10, yours will be different):
php7.1-curl/artful-updates,artful-security 7.1.15-0ubuntu0.17.10.1 amd64
CURL module for PHP
then, you just install it as usual:
sudo apt install php7.1-curl
happy coding!

Installation of php5-gmp on Ubuntu 16.04

Is there a way to find and install the php5-gmp module on Ubuntu 16.04? I looked for this repository but I can't find it here. In fact, when I tried to do:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5-gmp
The results is:
Unable to find php5-gmp package
Try php5.6-gmp:
sudo apt install php5.6-gmp
Obvously this will only install gmp extension for PHP5.6.
If you want it to 7.0, use the right package name:
sudo apt install php7.0-gmp

Error installing php5-mcrypt

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.
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
Had exactly the same problem. The accepted solution did not work for me. Took me eternities to figure a way.
sudo add-apt-repository -r ppa:ondrej/php5
sudo add-apt-repository -r ppa:ondrej/php5-oldstable
sudo add-apt-repository -r ppa:ondrej/php5-5.6
sudo apt-get purge php5* apache2* mcrypt*
sudo apt-get update
sudo apt-get upgrade
(WARNING: You'll lose all settings for your PHP and Apache installation!)
reinstall:
sudo apt-get install php5 php5-mcrypt php5-curl apache2
and enable the extensions
sudo php5enmod mcrypt
sudo php5enmod curl
Magic.
This is horrible, horrible, horrible. Adding ppa:ondrej/php5-5.6 together with ppa:ondrej/php5 and ppa:ondrej/php5-oldstable will bring you nothing at all, as you need exactly one of these (as one contains PHP 5.4, second PHP 5.5 and third PHP 5.6). Purging php5* and apache2* is also not necessary, you might want to purge apache2.2-common if you encounter an error upgrading, but that's it. And then mcrypt and curl modules will get enabled automatically (unless you have disabled them in the past), so php5enmod mcrypt and php5enmod curl is extra (but not harmful).

Categories