Install php5-dev Ubuntu 16.04 - php

I am following this tutorial to enable thread safety in php 5.6.
https://blog.bensoer.com/compile-thread-safe-php-5-6-20-from-source/
But when i am executing sudo apt-get install -y php5-dev It gives me the following output.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-dev 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 'php5-dev' has no installation candidate
How can I resolve this in Ubuntu 16.04?

sudo apt-get install -y php5.6-dev did the trick

Related

E: Unable to locate package php7.2-bcmath

I'm trying to install package php7.2-bcmath on Ubuntu 14.4
sudo apt-get install php7.2-bcmath
but I keep getting this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-bcmath
E: Couldn't find any package by regex 'php7.2-bcmath'
I already try those options:
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2-bcmath
add this to /etc/apt/sources.list:
deb http://security.ubuntu.com/ubuntu artful-security main universe
Nothing works!
Please help
You should check which PHP version is available and if you addressed the correct package name.
Use:
apt-cache search php
to check, if PHP7.2 and all the extensions are available at your environment.
Determine the correct package name of the bcmath package by searching trough all available packages:
apt-cache search php | grep bcmath
If you see an bcmath package for php7.2 use this name with the sudo apt-get install .... syntax.

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.

Your PHP installation appears to be missing the MySQL extension which is required by WordPress ubuntu 18.10

/etc/init.d/mysql status is running active
When I am trying to install php, I get this message:
sudo apt-get install php5.6-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5.6-mysql
E: Couldn't find any package by glob 'php5.6-mysql'
E: Couldn't find any package by regex 'php5.6-mysql'
To find out what packages exist in the repositories:
sudo apt search <package_name>
This will give you a list of packages that you can install, and this will allow you to check if the package php5.6-mysql actually exists (which it probably doesn't).
Once you've done that, you'll be able to install the correct package that you need!
The packages you probably want are php5-mysql and mysql-server.
So simply run:
sudo apt install php5-mysql mysql-server

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

Categories