0

I am running a VPS with Debian 10, Apache 2.4.38, PHP 7.3.4-2, MariaDB 10.3.15 and curl 7.64.0.

On one of the hosted, older websites I am running a script that uses curl_init(); which fails with the following error:

Error: Uncaught Error: Call to undefined function curl_init() in /var/www/example.com/public_html/_function.php:218
Stack trace:
#0  

On older versions of Debian / Ubuntu, the solution was to add the ppa:ondrej/php and then install php7.1-curl or later.

When I try to add the repository, I get the following error:

Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see 
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox '/tmp/tmp013x8d0y/pubring.gpg' created
gpg: /tmp/tmp013x8d0y/trustdb.gpg: trustdb created
gpg: key 4F4EA0AAE5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no valid OpenPGP data found.

I would appreciate your feedback how to get the key problem fixed and if this is the recommended way to get curl_init(); working in the described setting.

  • 1
    If you're using Debian, you should follow the [instructions for Debian](https://packages.sury.org/php/README.txt), not the instructions for Ubuntu. – Michael Hampton Aug 11 '19 at 23:35
  • How did you install the AMP part of your stack? If you used the `apt` utilities then use the same to install the `php-curl` package (check name and actual version - a simple `apt-cache search php curl` should find it) – ivanivan Aug 12 '19 at 00:13
  • Thanks, Michael. I followed your instructions, installed the missing extensions via `php-curl` and restarted Apache. It's working now. –  Aug 12 '19 at 00:20

0 Answers0