zl程序教程

您现在的位置是:首页 >  工具

当前栏目

php7.2调用curl_init()报错解决方案「建议收藏」

解决方案 报错 建议 收藏 调用 init CURL php7.2
2023-06-13 09:12:31 时间

大家好,又见面了,我是你们的朋友全栈君。

使用PHP7.2运行代码的时候出现提示curl_init()调用失败:

未定义的问题,即Call to undefined function curl_init()

解决方法:

1. 在linux终端键入apt-cache search curl |grep php

ubuntu@VM-16-9-ubuntu:/etc/php/7.2/apache2$ apt-cache search curl | grep php
php-curl - CURL module for PHP [default]
php7.2-curl - CURL module for PHP
php-http-request2 - Provides an easy way to perform HTTP requests

2. 找到php7.2-curl是我们需要的,输入sudo apt-get install php7.2-curl,正常情况安装成功就解决问题了。

参考:php7.2调用curl_init()失败的解决方案

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/158839.html原文链接:https://javaforall.cn