1

I installed on Ubuntu 16.10 the co-existing php packages as outlined in https://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04

I've run apt-get update and apt-get upgrade. When I try to install php-curl I get an error message:

randall@randall-VirtualBox3:/$ sudo apt-get install php5.6-curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5.6-curl
E: Couldn't find any package by glob 'php5.6-curl'
E: Couldn't find any package by regex 'php5.6-curl'
randall@randall-VirtualBox3:/$ php -v
PHP 5.6.30-12~ubuntu16.10.1+deb.sury.org+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.4, Copyright (c) 2002-2017, by Derick Rethans
randall@randall-VirtualBox3:/$ 

How do I fix?

Randall
  • 512
  • 1
  • 5
  • 15
  • Possible duplicate of [How to install php-curl in Ubuntu 16.04](https://stackoverflow.com/questions/38800606/how-to-install-php-curl-in-ubuntu-16-04) – fubar Aug 29 '17 at 22:38
  • Confirm that you have that version available `sudo apt-cache search php|grep curl` You may not have the proper version available. – Kamran Aug 29 '17 at 22:42

2 Answers2

4

To install php5.6-curl or anything, when you ran into trouble

  • first search your system to ensure that you have it in there.

    apt-cache search php | grep -i curl

Result

php5-curl - CURL module for php5

Now use:

apt-get install php5-curl -y

NJOY

Prince Adeyemi
  • 724
  • 6
  • 12
  • 1
    If I grep the cache I don't see a php5.6-curl. I'm using this repository https://launchpad.net/%7Eondrej/+archive/ubuntu/php/+index?batch=75&memo=225&start=225. I have to use php 5.* the web application I'm working on doesn't support a later version. – Randall Aug 29 '17 at 23:41
  • What did you see ? any php5-curl ? make sure that you do `apt-get update && apt-get upgrade -y` to update your repo then do grep command again. – Prince Adeyemi Aug 30 '17 at 01:37
  • Yes I had ran those commands. No php5-curl - "package ... is not avaiable". – Randall Aug 30 '17 at 16:25
  • try `apt-get install php-curl` then – Prince Adeyemi Aug 30 '17 at 16:29
3

u can fix by following steps:-

sudo apt-get install curl

sudo apt-get install php5.6-curl
Dhivin
  • 646
  • 6
  • 20