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

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.

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

While installing php7.3 it shows "Unable to locate package php7.3-fpm"

While installing php-fpm it shows an error:
E: Unable to locate package php7.3
E: Unable to locate package php7.3-fpm
Please tell me, how to solve this issue.
I am using Ubuntu 16.04 LTS server.
PHP 7.3 may not be available in Ubuntu 16.04 default repo, you need to add third party repo. I have used ondrej repo quiet often and it works great.
Run the below commands:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.3
You will need sudo permission to run the above commands.

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/

How to add curl on php7.2 and ubuntu 14

I am trying to install curl on my ubunutu 14 server with php 7.2 installed. I run the following command:
sudo apt-get install php7.0-curl
but it gives error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-curl
E: Couldn't find any package by regex 'php7.0-curl'
I then tried to resolve this issue by running commands:
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt install apache2 libapache2-mod-php7.0 php7.0
But that also end up with same "Couldn't find package" error.
Your Ubuntu distro trusty is too old and those packages aren't available. You will have to build the library from the source by yourself.
Here you can find solution your problem How do I install the ext-curl extension with PHP 7?
Shortly, try to execute
sudo apt-get install php-curl
Also you can use sudo apt-cache search curl which shows you available packages for installation.

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?

Categories