Unable to locate package php5 6 curl

I have a Linux server with Ubuntu 16.04 installed. I usit just for LAMPP environment, I have PHP 5.6 installed [in apache and CLI], that because the project crash with PHP7, so, I have to maintain in 5.6 version. I'm trying to run a PHP script from the CLI, and I gets: curl_init[] in unkown function. So, I went to the php.ini file [the one of the CLI] and unable the extension, but in CLI when I make: php --version I get:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_curl.dll' - /usr/lib/php/20131226/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0

Then I tried to install curl with: sudo apt-get install php5-curl but then I get:

E: Unable to locate package php5-curl

So, what should I do then? How can I install it?thanks

TL;DR: You can't install php5.6 on 14.04, consider upgrade releases.

Php 5.6 is still available on Ondrej's repository.

:~$ apt-cache policy php5.6
php5.6:
  Installed: 5.6.40-6+ubuntu18.04.1+deb.sury.org+3
  Candidate: 5.6.40-7+ubuntu18.04.1+deb.sury.org+1
  Version table:
     5.6.40-7+ubuntu18.04.1+deb.sury.org+1 500
        500 //ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages
        500 //ppa.launchpad.net/ondrej/php/ubuntu bionic/main i386 Packages
 *** 5.6.40-6+ubuntu18.04.1+deb.sury.org+3 100
        100 /var/lib/dpkg/status

The problem is you're using Ubuntu 14.04 which has reached End Of Life, it is recommended that you update to newer version.

The ppa maintainer has dropped support for Ubuntu 14.04, the supported releases is as follow:

  • Ubuntu 16.04 Xenial
  • Ubuntu 18.04 Bionic
  • Ubuntu 18.10 Cosmic
  • Ubuntu 19.04 Disco

You have to upgrade/fresh install above version of Ubuntu to get php5.6 working.

I think you'd want to upgrade to Xenial since it doesn't require any fresh installing method and can be upgraded directly.

Related How to install software or upgrade from an old unsupported release?

I am using php5.6 in my docker - FROM romeoz/docker-phpfpm:5.6
and below installation is failing all of sudden today, it was working fine when I last checked couple of days ago..please help!!

RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php

RUN apt-get update && apt-get install -y --no-install-recommends
libapache2-mod-php5.6
php5.6
php5.6-cli
php5.6-curl
php5.6-dev
php5.6-odbc
php5.6-mbstring
php5.6-mcrypt
php5.6-mysql
php5.6-xml
php5.6-xmlrpc
php5.6-soap

Error: E: Unable to locate package libapache2-mod-php5.6
E: Couldn't find any package by glob 'libapache2-mod-php5.6'
E: Couldn't find any package by regex 'libapache2-mod-php5.6'
E: Unable to locate package php5.6-dev
E: Couldn't find any package by glob 'php5.6-dev'
E: Couldn't find any package by regex 'php5.6-dev'
E: Unable to locate package php5.6-odbc
E: Couldn't find any package by glob 'php5.6-odbc'
E: Couldn't find any package by regex 'php5.6-odbc'
E: Unable to locate package php5.6-xmlrpc
E: Couldn't find any package by glob 'php5.6-xmlrpc'
E: Couldn't find any package by regex 'php5.6-xmlrpc'
E: Unable to locate package php5.6-soap

I am trying to install php v5.6 or 7.0 . However i am not being successful. I am following the below steps on ubuntu 12.04 LTS

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5

I am getting the following message

apt-get install php5
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 : Depends: libapache2-mod-php5 [>= 5.6.19+dfsg-1+deb.sury.org~precise+1~] but 5.3.10-1ubuntu3.21 is to be installed or
                 libapache2-mod-php5filter [>= 5.6.19+dfsg-1+deb.sury.org~precise+1~] but it is not going to be installed or
                 php5-cgi [>= 5.6.19+dfsg-1+deb.sury.org~precise+1~] but it is not going to be installed or
                 php5-fpm [>= 5.6.19+dfsg-1+deb.sury.org~precise+1~] but it is not going to be installed
        Depends: php5-common [>= 5.6.19+dfsg-1+deb.sury.org~precise+1~] but 5.3.10-1ubuntu3.21 is to be installed
E: Unable to correct problems, you have held broken packages.

Chủ Đề