PHP7.2
我在使用PHP7.2跑一段demo的时候出现提示curl_init()调用失败,未定义的问题,即Call to undefined function curl_init()
,找了很久才找到解决方案,其实很简单,就是没有对应版本的curl,python初来乍到,还望见谅
- 在linux终端键入
apt-cache search curl |grep php
,得到如下:
php-curl - CURL module for PHP [default]
php-http-request2 - Provides an easy way to perform HTTP requests
php-picofeed - Modern library to handle RSS/Atom feeds
php5-curl - CURL module for php5
php5.6-curl - CURL module for PHP
php7.0-curl - CURL module for PHP
php7.1-curl - CURL module for PHP
php7.2-curl - CURL module for PHP
即可看到支持版本CURL
- 随后键入
sudo apt-get install php7.2-curl
,正常情况安装成功就解决问题了。