Debian 10 和 PHP 7.3.4-2 - 调用未定义的函数 curl_init()

Debian 10 和 PHP 7.3.4-2 - 调用未定义的函数 curl_init()

我正在运行带有 Debian 10、Apache 2.4.38、PHP 7.3.4-2、MariaDB 10.3.15 和 curl 7.64.0 的 VPS。

在其中一个托管的较旧的网站上,我正在运行一个脚本,curl_init();该脚本失败并出现以下错误:

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

在旧版本的 Debian / Ubuntu 上,解决方案是添加ppa:ondrej/php然后安装php7.1-curl或更高版本。

当我尝试添加存储库时,出现以下错误:

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.

我将非常感激您的反馈,如何解决关键问题,以及这是否是curl_init();在所述设置下工作的推荐方法。

相关内容