1. <i id='iSj9p'><tr id='iSj9p'><dt id='iSj9p'><q id='iSj9p'><span id='iSj9p'><b id='iSj9p'><form id='iSj9p'><ins id='iSj9p'></ins><ul id='iSj9p'></ul><sub id='iSj9p'></sub></form><legend id='iSj9p'></legend><bdo id='iSj9p'><pre id='iSj9p'><center id='iSj9p'></center></pre></bdo></b><th id='iSj9p'></th></span></q></dt></tr></i><div id='iSj9p'><tfoot id='iSj9p'></tfoot><dl id='iSj9p'><fieldset id='iSj9p'></fieldset></dl></div>

        • <bdo id='iSj9p'></bdo><ul id='iSj9p'></ul>
        <legend id='iSj9p'><style id='iSj9p'><dir id='iSj9p'><q id='iSj9p'></q></dir></style></legend>

        <small id='iSj9p'></small><noframes id='iSj9p'>

      2. <tfoot id='iSj9p'></tfoot>

        如何正确设置 PHP 环境变量以在 Git Bash 中运行命令

        时间:2024-08-10
          <bdo id='CCeDF'></bdo><ul id='CCeDF'></ul>

          <i id='CCeDF'><tr id='CCeDF'><dt id='CCeDF'><q id='CCeDF'><span id='CCeDF'><b id='CCeDF'><form id='CCeDF'><ins id='CCeDF'></ins><ul id='CCeDF'></ul><sub id='CCeDF'></sub></form><legend id='CCeDF'></legend><bdo id='CCeDF'><pre id='CCeDF'><center id='CCeDF'></center></pre></bdo></b><th id='CCeDF'></th></span></q></dt></tr></i><div id='CCeDF'><tfoot id='CCeDF'></tfoot><dl id='CCeDF'><fieldset id='CCeDF'></fieldset></dl></div>

            <tbody id='CCeDF'></tbody>

          1. <tfoot id='CCeDF'></tfoot>

                  <small id='CCeDF'></small><noframes id='CCeDF'>

                  <legend id='CCeDF'><style id='CCeDF'><dir id='CCeDF'><q id='CCeDF'></q></dir></style></legend>
                  本文介绍了如何正确设置 PHP 环境变量以在 Git Bash 中运行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  整个网站都有一些类似的问题,但没有一个给出我正在寻找的答案.

                  There are a few similar questions as this throughout the site, but none of them are giving me the answer I'm looking for.

                  我正在尝试通过 Git Bash 在具有 WAMP 的 Windows 机器上安装 Composer.

                  我正在使用以下命令:

                  What I'm trying to do is install Composer via Git Bash on a Windows machine that has WAMP.

                  I'm using the following command:

                  curl -s http://getcomposer.org/installer | php
                  

                  这不起作用,因为无法识别php".所以我研究了这个问题,我意识到Windows不知道'php'是什么,我需要设置一个环境变量.

                  This is not working, as 'php' is not recognized. So I looked into the problem and I realized that Windows does not know what 'php' is, and I need to set an environment variable.

                  我进入环境变量对话框并输入 'php' 作为变量和 C:wampinphpphp5.3.8 作为值.这个对吗?我应该针对特定文件还是整个目录?

                  I go into the environment variable dialogue and enter 'php' as the variable and C:wampinphpphp5.3.8 as the value. Is this correct? Should I be targeting a specific file or the directory as a whole?

                  执行此操作后,我再次尝试该命令,但由于它仍然无法识别php"而失败.我也试过将文件路径直接放入命令中,但也没有用.

                  After doing this, I try the command again and it fails because it still does not recognize 'php'. I have also tried putting the file path into the command directly, but that didn't work either.

                  所以我很好奇我做错了什么.我的路径不正确吗?

                  So I am curious as to what I am doing incorrectly. Is my path incorrect?

                  推荐答案

                  将路径添加到 PATH 变量应该可以解决这个问题.

                  Adding the path to your PATH variable should fix that.

                  右击我的电脑,进入高级设置,点击环境变量,然后编辑PATH系统变量.

                  Right click My Computer, go to advanced settings, click Environment Variables then edit the PATH system variable.

                  添加分号,然后添加 PHP 二进制文件的路径,即;C:wampinphpphp5.3.8"

                  Add a semi-colon and then the path to your PHP binary, i.e. ";C:wampinphpphp5.3.8"

                  最后,重启 Git Bash 以更新 PATH 变量.

                  Finally, restart the Git Bash so that it updates the PATH variable.

                  这篇关于如何正确设置 PHP 环境变量以在 Git Bash 中运行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:环境变量和 PHP 下一篇:同一服务器上的两个 Laravel 应用程序相互冲突

                  相关文章

                  <tfoot id='2jeE8'></tfoot>
                1. <legend id='2jeE8'><style id='2jeE8'><dir id='2jeE8'><q id='2jeE8'></q></dir></style></legend>

                      <bdo id='2jeE8'></bdo><ul id='2jeE8'></ul>

                  1. <small id='2jeE8'></small><noframes id='2jeE8'>

                  2. <i id='2jeE8'><tr id='2jeE8'><dt id='2jeE8'><q id='2jeE8'><span id='2jeE8'><b id='2jeE8'><form id='2jeE8'><ins id='2jeE8'></ins><ul id='2jeE8'></ul><sub id='2jeE8'></sub></form><legend id='2jeE8'></legend><bdo id='2jeE8'><pre id='2jeE8'><center id='2jeE8'></center></pre></bdo></b><th id='2jeE8'></th></span></q></dt></tr></i><div id='2jeE8'><tfoot id='2jeE8'></tfoot><dl id='2jeE8'><fieldset id='2jeE8'></fieldset></dl></div>