1

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.

Community
  • 1
  • 1
farazch
  • 21
  • 3
  • You want curl on PHP 7.2 while you install the php7.0-curl, try change it to `php7.2-curl` – catcon Jul 25 '19 at 06:25
  • I did bt it is giving same error. – farazch Jul 25 '19 at 06:47
  • Ubuntu 14 is now in security maintenance only support so you are not getting anything new. You also can not use Ondřej Surý' PPA because he only supports 16.04+. At this point in time you are probably best to update to a newer version of ubuntu. – Ne Ma Jul 25 '19 at 07:25

2 Answers2

1

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.

Mike Doe
  • 16,349
  • 11
  • 65
  • 88
0

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.

potiev
  • 546
  • 2
  • 11
  • When i run command: sudo apt-get install php-curl It gives same error of "Couldn't find any package" When i run search command to see available packages, it shows "php5-curl" and not "php7-curl" . Link you shared have exactly same commands which i tired and giving unable to locate package error. – farazch Jul 25 '19 at 06:57