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没有看到它。