Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 将--http2.0选项与curl 7.33.0一起使用会给出不受支持的协议_Linux_Curl_Http2_Nghttp2 - Fatal编程技术网

Linux 将--http2.0选项与curl 7.33.0一起使用会给出不受支持的协议

Linux 将--http2.0选项与curl 7.33.0一起使用会给出不受支持的协议,linux,curl,http2,nghttp2,Linux,Curl,Http2,Nghttp2,我使用的是centos 6.2,我需要在一个服务器请求中使用curl--http2.0,但我使用的是7.19.6,在查看了之后,我发现--http2.0选项仅支持curl 7.33.0,因此为了克服这个问题,我按照 安装curl后,我尝试使用它,但它仍然给我错误为curl(1):不受支持的协议,我使用:curl--version检查了我的curl版本这给了我: curl 7.33.0 (x86_64-unknown-linux-gnu) libcurl/7.33.0 OpenSSL/1.0.0

我使用的是centos 6.2,我需要在一个服务器请求中使用curl--http2.0,但我使用的是7.19.6,在查看了之后,我发现--http2.0选项仅支持curl 7.33.0,因此为了克服这个问题,我按照 安装curl后,我尝试使用它,但它仍然给我错误为curl(1):不受支持的协议,我使用:curl--version检查了我的curl版本这给了我:

curl 7.33.0 (x86_64-unknown-linux-gnu) libcurl/7.33.0 OpenSSL/1.0.0 zlib/1.2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz 
我需要使用这个--http2.0,但是没有得到任何东西,我怎么能做到呢? 安装了curl 7.19,我用更高的版本重新安装了curl,这会产生任何问题吗?

正如Daniel所解释的:

我的计划是将http2工作建立在nghttp2库的基础上 ()[…]在libcurl术语中,HTTP2将作为一个“特性”开始,而不是专门作为一个单独的协议

因此,首先需要手动安装[1]

然后,您需要在配置时使用
--with-nghttp2
显式启用HTTP2支持:

./configure --with-nghttp2=/path/to/nghttp2/install/dir [...]
[1] :在编写自述文件时,自述文件声明它没有打包在Ubuntu中,因此您需要自己构建它

编辑

请查找以下基本说明,以使用默认选项仅构建库(而不是命令行工具)

要构建nghttp2,首先需要安装其要求(如中所述):

完成后,克隆回购协议:

git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
按照以下说明构建库:

然后部署它:

make install
如果一切正常,那么您需要通过使用
/configure--with-nghttp2=/usr/local[…]
启用nghttp2来构建libcurl 7.33.0

附加服务

如果您还想构建应用程序(
nghttp
,…),则必须在构建nghttp2之前安装其他软件包:

yum install openssl-devel
yum install libevent-devel
yum install libxml2-devel
yum install jansson-devel

我不能安装它,你能给我一步一步安装它的所有指示,因为我是linux的新手用户。。。感谢您的支持如果可能,请给出支持itI所需的其他软件的说明。我已使用nghttp2库构建说明编辑了我的问题。autoreconf-我给出的错误为:perl:警告:设置语言环境失败。perl:警告:请检查您的系统是否支持并安装了语言环境设置:LANGUAGE=(unset)、LC_ALL=(unset)、LC_CTYPE=“UTF-8”、LANG=“en_US.UTF-8”。perl:警告:返回到标准语言环境(“C”)
configure.ac:205:警告:在库autoreconf:/usr/bin/autoconf中找不到宏'AM_PATH_XML2',退出状态为:1Great!我已经用可能需要的额外软件包(特别是
libxml2-devel
)再次编辑了我的answser,我认为您安装它是为了修复配置错误。
make install
yum install openssl-devel
yum install libevent-devel
yum install libxml2-devel
yum install jansson-devel