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/
Related
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.
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.
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
I want to install php7 or 7.1 in Ubuntu but i can't
I try with this code :
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
and this is result :
sudo: unable to resolve host myvps
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 regex 'php7.1'
Also for PHP 7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0
E: Couldn't find any package by regex 'php7.0'
But i know i can install php5 but i don't want !
se result of this commend php -v
root#myvps:~# php -v
The program 'php' is currently not installed. You can install it by typing:
apt-get install php5-cli
and here is my ubuntu information :
root#myvps:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
whats wrong ? is it possible to solve this problem ?
All code is correct however we need to attention to Kernel release end of life it is so important !
My problem is from here !
and for solve that we have 2 option :
first upgrade Kernel release (recommended)
second use from this hack (at your own risk)
Try without adding any repositories.
sudo apt-get install php7.0
I have been installing php7.0-fpm via ppa:ondrej/php on Ubuntu using the following commands without issue over the last few months whilst preparing my new server;
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.0-fpm
Today, I tried to install again using the same commands as above, and now I get a failure with the final command as follows;
root#10:/etc/apt/sources.list.d# apt-get install php7.0-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-fpm
E: Couldn't find any package by regex 'php7.0-fpm'
Any clues as to why this install command set has suddenly stopped working?!
The same error is recorded when trying to install php7.0-mysql, which again was working fine until recently.
Many thanks in advance,
Dave
I have found a resolution for this as shown below.
The Ubuntu version I was using was 15.04, which is now out of support.
After upgrading my install to Ubuntu 15.10 the installation of php7.0-fpm and php7.0-mysql work as expected.
It appears that the php7.0-* packages have been removed from the Ubuntu 15.04 version of the ppa:ondrej/php repo, but are available in the 15.10 version.
Currently upgrading all my servers based on this change.
Dave
The dotdeb repository seems to be working with the 7.0 extensions for me:
https://www.dotdeb.org/instructions/
It's probably not ideal, but:
"Depending on your distribution (Jessie, Wheezy or Squeeze), add these two lines to your /etc/apt/sources.list file (you can also choose a mirror near you) :"
deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all
Then you should be able to install everything with:
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv