本文共 7181 字,大约阅读时间需要 23 分钟。
本文翻译自:
I am having trouble getting curl to run on Windows. 我无法在Windows上运行curl。
I have downloaded a curl zip file from , but it seems to contain source code, not an executable. 我从下载了一个curl zip文件,但它似乎包含源代码,而不是可执行文件。
Do I need to compile curl to run it? 我是否需要编译curl才能运行它? If yes, then how do I do that? 如果是,那我该怎么做?
Where can I find .exe
downloads for curl? 我在哪里可以找到curl的.exe
下载?
I have looked for documentation on installing curl, but there is little to be found. 我已经查找了有关安装curl的文档,但几乎没有找到。
参考:
It is possible that you won't need to download anything: 你可能不需要下载任何东西:
If you have installed (if you downloaded Git from , the answer is yes), you have curl.exe
under: 如果你安装了 (如果你从下载了Git,答案是肯定的),你有curl.exe
:
C:\\Program Files\\Git\\mingw64\\bin\\
Simply add the above path to PATH
. 只需将上述路径添加到PATH
。
If you are already using a package manager, it may be more convenient to install with one: 如果您已经在使用软件包管理器,则安装一个软件包可能更方便:
choco install curl
对于 ,运行choco install curl
pacman -S curl
对于 ,运行pacman -S curl
scoop install curl
对于 ,运行scoop install curl
It is too easy to accidentally download the wrong thing. 很容易意外地下载错误的东西。 If, on the , you click the large and prominent "Download" section in the site header, and then the large and prominent curl-7.62.0.tar.gz
link in its body, you will have downloaded a curl source package , which contains curl's source code but not curl.exe
. 如果在单击网站标题中较大且突出的“下载”部分,然后curl-7.62.0.tar.gz
其主体中的大而突出的curl-7.62.0.tar.gz
链接,您将下载一个卷曲源包 ,其中包含curl的源代码但不包含curl.exe
。 Watch out for that. 注意这一点。
Instead, click the large and prominent download links . 而是单击的大而重要的下载链接。 Those are the official Windows builds, and they are provided by the project. 这些是官方的Windows版本,它们由项目提供。
If you have more esoteric needs (eg you want cygwin builds, third-party builds, libcurl, header files, sources, etc.), use the curl . 如果您有更多深奥的需求(例如,您需要cygwin构建,第三方构建,libcurl,头文件,源等),请使用curl 。 After answering five questions, you will be presented with a list of download links. 回答完五个问题后,您将看到一个下载链接列表。
Find curl.exe
within your downloaded package; 在下载的包中找到curl.exe
; it's probably under bin\\
. 它可能在bin\\
。
Pick a location on your hard drive that will serve as a permanent home for curl: 选择硬盘上的一个位置,作为卷曲的永久主页:
C:\\Program Files\\curl\\
or C:\\curl\\
will do. 如果你想给curl一个自己的文件夹, C:\\Program Files\\curl\\
或C:\\curl\\
会这样做。 PATH
, use a single folder such as C:\\Program Files\\tools\\
or C:\\tools\\
for the purpose. 如果您有许多松散的可执行文件,并且您不想将许多单个文件夹添加到PATH
,请使用单个文件夹,例如C:\\Program Files\\tools\\
或C:\\tools\\
。 Place curl.exe
under the folder. 将curl.exe
放在该文件夹下。 And never move the folder or its contents. 永远不要移动文件夹或其内容。
Next, you'll want to make curl available anywhere from the command line. 接下来,您将希望在命令行的任何位置都可以使用curl。 To do this, add the folder to PATH
, like this: 为此,请将文件夹添加到PATH
,如下所示:
curl.exe
lives. 单击“ 添加”按钮并粘贴curl.exe
所在的文件夹路径。 PATH
. 关闭打开的控制台窗口并重新打开,这样他们就可以获得新的PATH
。 Now enjoy typing curl at any command prompt. 现在喜欢在任何命令提示符下键入curl。 Party time! 晚会时间!
You can build the latest version of curl, openssl, libssh2 and zlib in 3 simple steps by following 按照 ,您可以通过3个简单步骤构建最新版本的curl,openssl,libssh2和zlib
Curl is built statically so you do not have to distribute the prerequisite dynamic runtime. Curl是静态构建的,因此您不必分发必备动态运行时。
You can also download a prebuilt version (x86 and x64) from 您还可以从下载预构建版本(x86和x64)
The simplest tutorial for setting up cURL on Windows is the . 在Windows上设置cURL的最简单的教程是 。 It only have 3 easy steps . 它只有3个简单的步骤 。
As you already know, you can find several packages of binaries on the official curl website. 如您所知,您可以在官方卷曲网站上找到几个二进制包。
Once you download a package, unzip it wherever you want. 下载软件包后,将其解压缩到任意位置。 I recommend adding its location to your path, so you can call curl from batch or powershell scripts. 我建议将其位置添加到路径中,这样您就可以从批处理或PowerShell脚本调用curl。 To add a directory to your path type "environment variables" in the start menu, and select "edit user environment variables". 要在路径中添加目录,请在开始菜单中键入“环境变量”,然后选择“编辑用户环境变量”。 Select Path, and add to the end of the "value" box: ;C:\\curl\\directory (with the directory changed to where you saved curl.) 选择Path,并添加到“value”框的末尾:; C:\\ curl \\ directory(将目录更改为保存curl的位置。)
If you want to use SSL you need a certificate bundle. 如果要使用SSL,则需要证书包。 Run either mk-ca-bundle.pl (perl) or mk-ca-bundle.vbs (VBScript). 运行mk-ca-bundle.pl(perl)或mk-ca-bundle.vbs(VBScript)。 Some of the packages of binaries include one or both of them. 一些二进制包包括其中一个或两个。 If your download doesn't include one, download one here: . 如果您的下载不包含,请在此处下载: : 。 I recommend mk-ca-bundle.vbs, as on windows you simply double click it to run it. 我推荐使用mk-ca-bundle.vbs,因为在Windows上只需双击它即可运行它。 It will produce a file called ca-bundle.crt. 它将生成一个名为ca-bundle.crt的文件。 Rename it curl-ca-bundle.crt and save it in the directory with curl.exe. 将其重命名为curl-ca-bundle.crt并将其保存在curl.exe目录中。
Alternatively, I recently developed an msi installer that sets up a full featured build of curl with just a few clicks. 或者,我最近开发了一个msi安装程序,只需点击几下即可设置完整的curl版本。 It automatically ads curl to your path, includes a ready-to-use ssl certificate bundle, and makes the curl manual and documentation accessible from the start menu. 它自动广告卷曲到您的路径,包括一个现成的ssl证书包,并使开始菜单中的卷曲手册和文档可访问。 You can download it at . 您可以在下载。
To run curl from the command line 从命令行运行curl
a) Right-hand-click on "My Computer" icon a)右键单击“我的电脑”图标
b) Select Properties b)选择“属性”
c) Click 'Advanced system settings' link c)单击“高级系统设置”链接
d) Go to tab [Advanced] - 'Environment Variables' button d)转到选项卡[高级] - “环境变量”按钮
e) Under System variable select 'Path' and Edit button e)在系统变量下,选择“路径”和“编辑”按钮
f) Add a semicolon followed by the path to where you placed your curl.exe (eg ;D:\\software\\curl) f)添加一个分号,然后添加你放置curl.exe的路径(例如; D:\\ software \\ curl)
Now you can run from the command line by typing: 现在,您可以通过键入以下命令从命令行运行:
curl www.google.com
转载地址:http://duexb.baihongyu.com/