吴彦杰 發表於 2025-3-22 00:00:00

windows中curl 怎么设置环境变量【图文教程】

<p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">&nbsp; 新手在下载cURL使用的时候,如果是在Windows系统里面,若不配置环境变量,最终是执行不了的就会提示:<strong style="margin: 0px; padding: 0px;">cURL不是内部或外部命令,也不是可运行的程序</strong>。下面IT备忘录小编就给大家制作了<strong style="margin: 0px; padding: 0px;">cURL Windows环境变量配置</strong>图文教程。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="cURL Windows环境变量配置" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-240119111145148.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 442px; width: 677px;"/></p><h2 style="margin: 20px 0px; padding: 0px 0px 0px 10px; font-size: 16px; position: relative; font-family: " microsoft="">
        方法步骤:</h2><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><strong style="margin: 0px; padding: 0px;">方法一:以win7为例子</strong></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        1、先下载好<span style="margin: 0px; padding: 0px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px;text-decoration:underline;"><strong style="margin: 0px; padding: 0px;">cURL For Windows版本</strong></span></span>,并解压至电脑比如:D盘,我的路径是:D:\soft\curl-7.84.0_8-win64-mingw\bin,如下图所示:</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="1、先下载好cURL版本,并解压至电脑比如:D盘,我的路径是:D:\soft\curl-7.84.0_8-win64-mingw\bin" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-2401191111451C.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 366px; width: 754px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        2、在桌面:计算机,图标上单击鼠标右键--属性。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="2、在桌面:计算机,图标上单击鼠标右键--属性。" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-240119111145136.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 295px; width: 263px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        3、单击:高级系统设置。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="3、单击:高级系统设置。" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-240119111145528.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 306px; width: 590px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        4、单击:环境变量(N)</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="4、单击:环境变量(N)" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-2401191111463b.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 442px; width: 420px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        5、点击:新建--变量名:curl,变量值:第一步,解压至电脑的目录路径,比如:D:\soft\curl-7.84.0_8-win64-mingw\bin--确定。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="5、点击:新建--变量名:curl,变量值:第一步,解压至电脑的目录路径,比如:D:\soft\curl-7.84.0_8-win64-mingw\bin--确定。" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-24011911114Aa.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 406px; width: 394px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        6、再在:系统变量,里面找到:Path--选中--编辑</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="6、再在:系统变量,里面找到:Path--选中--编辑" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-24011911114BK.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 442px; width: 420px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        7、在变量值末尾,添加&nbsp;<span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255);"><strong style="margin: 0px; padding: 0px;">;%curl%</strong></span>,再点击:确定。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="7、在变量值末尾,添加:;%curl%,再点击:确定。" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-240119111146334.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 442px; width: 420px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        8、最后在CMD命令提示符下面输入:<span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255);"><strong style="margin: 0px; padding: 0px;">curl -V</strong></span>,看到cURL的版本号就代表环境变量配置成功了。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><img alt="8、最后在CMD命令提示符下面输入:curl -V,看到cURL的版本号就代表环境变量配置成功了。" src="https://zhuji.jb51.net/uploads/allimg/20240119/1-2401191111463G.jpg" style="max-width:100%!important;height:auto!important;margin: 10px auto; padding: 0px; border: 0px; display: block; max-width: 100%; height: 442px; width: 677px;"/></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><strong style="margin: 0px; padding: 0px;">方法二:</strong></p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:="">
        当然还有一种方法就是直接将下载的cURL:bin目录下的文件全部复制到:<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255);">C:\Windows\System32</span></strong>&nbsp;目录下,<span style="margin: 0px; padding: 0px; color: rgb(255, 140, 0);"><strong style="margin: 0px; padding: 0px;">此方法无需配置环境变量</strong></span>,但是可能有的用户电脑会因为权限问题导致失败,不过也是有解决方法的。</p><p style="margin-top: 0px; margin-bottom: 20px; padding: 0px; font-family: " microsoft="" font-size:=""><strong>注意:添加环境变量<span class="content-right_8Zs40">前打开的cmd窗口,识别不到新添加的环境变量。 <em>解决:关掉当前的命令窗口,另开一个就可以了</em>。</span></strong><br/></p><p><br/></p>
頁: [1]
查看完整版本: windows中curl 怎么设置环境变量【图文教程】