php 在 composer laravel 上安装依赖项(doctrine/dbal)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22413408/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install dependency (doctrine/dbal) on composer laravel
提问by elvainch
I am trying to execute a migration to rename some columns and I got an exception.
我正在尝试执行迁移以重命名某些列,但出现异常。
As I read on the documentation I have to add the doctrine/dbal dependency to my composer.json file. How do I do that? Which is the correct composer.json file. I have many in my application. Is the one that is on the same level as the folders app,bootstrap, public and vendor.
当我阅读文档时,我必须将学说/dbal 依赖项添加到我的 composer.json 文件中。我怎么做?哪个是正确的 composer.json 文件。我的申请中有很多。是与文件夹 app、bootstrap、public 和 vendor 处于同一级别的那个。
If so how do I add that dependency. Do I have to download anything?
如果是这样,我如何添加该依赖项。我必须下载任何东西吗?
By the way im using easyphp, not wamp!
顺便说一句,我使用的是easyphp,而不是wamp!
Edit 1
编辑 1
After doing that the console throws this error
这样做之后,控制台会抛出这个错误


回答by Yogesh Yadav
1) To install dependency , run this command
1) 要安装依赖项,请运行此命令
composer require doctrine/dbal
2) For 'git' is not recognized error, either you don't have git installed or the PATH is not added in the environment variables.
2) 对于“git”无法识别的错误,要么你没有安装 git,要么环境变量中没有添加 PATH。
回答by tliokos
To add this dependency open the composer.json at the root of your project (in the same level as app, public etc.) and in the require section add the doctrine/dbal package like:
要添加此依赖项,请打开项目根目录下的 composer.json(与 app、public 等处于同一级别)并在 require 部分中添加如下的 dotric/dbal 包:
"require": {
"laravel/framework": "4.1.*",
"doctrine/dbal": "v2.4.2"
},
Save the file and run composer update
保存文件并运行 composer update
Edit
编辑
You probably installed git with the default settings and it's not in your PATH env.
您可能使用默认设置安装了 git,但它不在您的 PATH 环境中。
Open Git Bash (it was installed with git - you will find it in your programs) and do composer update. By the way it's far better that windows command prompt.
打开 Git Bash(它是与 git 一起安装的 - 你会在你的程序中找到它)并执行composer update. 顺便说一句,Windows 命令提示符要好得多。

