php安装swoole时curl不存在解决办法

php安装swoole的时候一般都会开启swoole-curl,但如果没用安装libcurl库就会提示error: curl/curl.h: No such file or directory。

swoole安装命令:

pecl install -D 'enable-sockets="no" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="no" enable-swoole-curl="yes" enable-cares="yes"' swoole

如果出现curl错误,则是因为libcurl库没用安装。

Debian/Ubuntu系统:

apt-get install libcurl4-openssl-dev

RHEL/CentOS系统:

yum install libcurl-devel

macOS系统:

brew install curl

评论