0

For your reference, please:

OS: Ubuntu 16.04 PHP: PHP 7.2.34 NGIX: nginx/1.10.3 (Ubuntu)

I'm having a problem installing php curl. I already tried commands I found online but still, no luck.

Any help would be appreciated. Thank you in advance :)

I already tried these commands:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.2-curl

But I always have this result:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'
E: Couldn't find any package by regex 'php7.2-curl'

When I try this command:

sudo apt-get update
sudo apt install php-curl

This is the result:

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:
 php-curl : Depends: php7.0-curl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
rencie
  • 1
  • 1
    did u try `sudo apt install php7.0-curl` ? – Ken Lee Dec 01 '22 at 03:34
  • just installing is not enough. you have to enable it and then restart the server. check: https://stackoverflow.com/questions/6382539/call-to-undefined-function-curl-init – Mash tan Dec 01 '22 at 03:40
  • See https://stackoverflow.com/questions/33775897/how-do-i-install-the-ext-curl-extension-with-php-7 too – Ken Lee Dec 01 '22 at 03:59
  • Yes, I also tried to install php7.0-curl but this is the result: ```The following packages have unmet dependencies: php7.0-curl : Depends: php7.0-common (= 7.0.33-0ubuntu0.16.04.16) but 7.0.33-50+ubuntu16.04.1+deb.sury.org+1 is to be installed E: Unable to correct problems, you have held broken packages.``` I also restart the server every time I run the installation command @KenLee – rencie Dec 02 '22 at 02:23
  • Please check whether you have something like `deb http://packages.dotdeb.org xxxx` in your `/etc/apt/sources.list file`. If this is the case, **remark** all the lines containing `dotdeb.org` and do a `apt-get update` , then re-try installing the php-curl by `sudo apt install php-curl` – Ken Lee Dec 02 '22 at 03:32
  • Thank you for your response @KenLee but I checked the sources.list, all I can see is about ```deb http://archive.ubuntu.com/ubuntu/ ``` – rencie Dec 02 '22 at 04:11

0 Answers0