Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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
Php 错误:找不到git-使用composer windows安装laravel_Php_Git_Laravel 4_Composer Php - Fatal编程技术网

Php 错误:找不到git-使用composer windows安装laravel

Php 错误:找不到git-使用composer windows安装laravel,php,git,laravel-4,composer-php,Php,Git,Laravel 4,Composer Php,我得到一个错误,说: failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in your PATH env. 'git' is not recognized as and internal or external command, operable program or batch file 当我尝试运行composer create pro

我得到一个错误,说:

failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in your PATH env.

'git' is not recognized as and internal or external command, operable program or batch file
当我尝试运行
composer create project laravel/laravel learning laravel

我安装了gitgui,它也附带了一个命令行shell,但我不知道为什么它不能识别该命令(我在正常的windows命令行提示符下发出createproject命令)

我还尝试从gitshell运行该命令,这很有效,但是当我尝试
phpatrisanserve
时,它给了我一个错误,说CLI已经停止工作


有人知道如何修复git错误吗?我宁愿使用windows命令shell而不是git命令shell,因为它可以进入我的wamp/www文件

如果您想在常规命令提示符下使用它,您需要将git添加到系统路径中

以下是有关在Windows中修改系统路径的指南:


您需要将安装git的目录添加到PATH环境变量中

  • 右键单击
    计算机
  • 单击高级系统设置
  • 单击高级菜单中的环境变量
  • 在系统变量下,滚动至路径
  • 添加
    ;“C:\path\to\git\bin”;“C:\path\to\git\cmd”

  • 在命令提示符下测试git命令,看看它是否有效。Git通常位于
    程序文件
    程序文件(x86)

    您需要卸载git并在选项中重新安装(或更新),您只需要从git bash更改为允许将git添加到命令行,而且由于它随后将git添加到您的路径,您可能需要也可能不需要重新启动计算机

    我在Windows上使用git时遇到一些问题。我只找到了这个信息,它对我有用

    在Windows中添加路径变量有一种更简单(但暂时)的方法

    将其粘贴到命令提示符中:

    SET PATH=%PATH%;C:\Program Files\Git\bin
    

    这将适用于命令提示符会话的其余部分。在此之前不要忘了安装Git。

    有什么办法吗?我以前从未做过类似的事情,或者你可以自己将它添加到路径中,就像其他答案所建议的那样。我的系统路径中已经有两个git路径,windows命令提示符可以识别git,但composer没有看到它。