How can I install php7.4 on Ubuntu 19.04? - php

After adding the ppa ondrej/php, I try sudo apt-get install php7.4, but the output is
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'
I have checked and there is a package that should install with that command, but I must be doing something wrong?

have you tried updating your rep?
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4
php -v
I didn't pay enough attention, this package doesn't exist yet for ubuntu 19.04:
php7.4 7.4.2-6+ubuntu19.10.1+deb.sury.org+1 Ondrej Surý (2020-02-05)
php7.4 7.4.2-6+ubuntu18.04.1+deb.sury.org+1 Ondrej Surý (2020-02-05)
php7.4 7.4.2-6+ubuntu16.04.1+deb.sury.org+1 Ondrej Surý (2020-02-05)

Related

Can't install php8.0-curl on Ubuntu 21.10

I'm trying to install php8.0-curl on my server.
But it keeps giving me the following error:
$ sudo apt install php8.0-curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0-curl
E: Couldn't find any package by glob 'php8.0-curl'
I followed the following steps, but with no success.
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install curl
sudo apt install php8.0-curl
I was using the wrong repositories.
Following this answer solved the issue.
https://serverfault.com/a/1106701

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

Ubuntu 14.04: Unable to locate package php7.0-zip

I am not being able to install package php7.0-zip. The error I get after doing
sudo apt-get install php7.0-zip
Is:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-zip
E: Couldn't find any package by regex 'php7.0-zip'
This is for an Ubuntu 14.04.5 LTS. My PHP version is 7.0.17.
I tried doing:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
And still getting the same "unable to locate" error.
I expect to solve my "Fatal error: Class 'ZipArchive' not found in" in Laravel 5.4, after installing zip package.
if you do sudo apt-cache search php7.0-* you should get a list of all packages.
The zip module should be at the bottom
If it isn't there you might wish to try
sudo add-apt-repository ppa:ondrej/php && sudo apt-get update instead of just add-apt-repository ppa:ondrej/php and see if that makes a difference.
Finally I couldn't find the package because I was using Ubuntu 14.04, and as is an unsupported Ubuntu version, there is no more php packages in the repository.

Install mysql pdo for php 7.1 for Ubuntu

I'm trying to install pdo mysql on ubuntu for php 7.1
sudo apt-get install php7.1-mysql
But I got E: Unable to locate package php7.1-mysql
Then I tried install from ondrej repository
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1-mysql
Still I got
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1-mysql
E: Couldn't find any package by regex 'php7.1-mysql'
At the moment I haven't got any pdo modules enabled;
Can someone help please?

Error while installing php 7.2 in ubuntu 17.04

I got this error when run below command
sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm
Reading state information... Done
E: Unable to locate package php7.2
E: Couldn't find any package by glob 'php7.2'
E: Couldn't find any package by regex 'php7.2'
E: Unable to locate package php7.2-common
E: Couldn't find any package by glob 'php7.2-common'
E: Couldn't find any package by regex 'php7.2-common'
E: Unable to locate package php7.2-cli
E: Couldn't find any package by glob 'php7.2-cli'
E: Couldn't find any package by regex 'php7.2-cli'
E: Unable to locate package php7.2-fpm
E: Couldn't find any package by glob 'php7.2-fpm'
E: Couldn't find any package by regex 'php7.2-fpm'
You need to manually add the ondrej PPA to be able to install PHP7.2 on Ubuntu 17.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
Or, by compiling it from the source by cloning the git repository, checking out the version that you want, make & make install
For more informations about compiling PHP from the source check out how to build/compile PHP from the source.
I had a similar problem.
This page helped me resolve it.
https://tecadmin.net/install-php-debian-9-stretch/
specifically, running these commands prior to the php install
sudo apt install ca-certificates apt-transport-https
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
Completely remove ALL versions of PHP
sudo apt-get purge 'php*'
Force update from unsigned repository:
Add this option in your sources.list (located at /etc/apt/sources.list):
deb [trusted=yes] https://deb.sury.org/ stretch main
Upgrade the current packages to the latest version:
sudo apt update
sudo apt upgrade
Install the required packages first on your system:
sudo apt install ca-certificates apt-transport-https
Then import packages signing key:
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
After that configure PPA for the PHP packages on your system:
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
Lastly, use one of the below options to install PHP of your requirements:
For installing PHP 7.2
sudo apt install php7.2-cli
For installing PHP 7.1
sudo apt install php7.1-cli
In my case a newer php was installed (7.4), so i just replaced the command with the 7.4 versions
sudo apt install php7.4 php7.4-common php7.4-cli php7.4-fpm
to know the version of php installed, use:
php --version
If you getting error like php7.2 php7.2-curl doesn't have installable candidate or not locate any package or dependencies is php7.2-common Or libcurl3 Do this . Remeber Change your package name as per your requirements
You have to tackle in mature way. Install aptitude these ubuntu package manager will finds all dependencies, and will install one by one.
apt-get install aptitude
Now you have to check if aptitude can download it or not if download it follow instructions
sudo aptitude install php7.2-curl
If you have gotten any error like this
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'
Any type on error i'm not talking about proper these errors
Try to add php package again
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
Now try this command
sudo aptitude install php7.2-curl
Aptitude will ask you you want to keep current version of all dependencies
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) php7.2-curl [Not Installed]
Accept this solution? [Y/n/q/?]
Type n then Enter
Aptitude will find all dependencies and ask you to install all package type
y
Again
y
Then
systemctl restart apache2
For centos of rhel
systemctl restart httpd
It will Not enabling PHP 7.2 FPM by default.
NOTICE: To enable PHP 7.2 FPM in Apache2 do
a2enmod proxy_fcgi setenvif
a2enconf php7.2-fpm
This method is not only for this error you can find any of php apache2 or ubuntu system package solution using aptitude.
Upvote if you find your solution

Categories