运行 Composer 返回:“无法打开输入文件:composer.phar";

编程入门 行业动态 更新时间:2024-10-23 23:23:18
本文介绍了运行 Composer 返回:“无法打开输入文件:composer.phar";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是 symfony2 的新手,正在阅读 symblog.在第三章尝试使用数据夹具时,我尝试了以下命令:

I am new to symfony2 and reading symblog. In third chapter while trying with data-fixtures I tried the command:

php composer.phar 更新

但我得到了错误:

无法打开输入文件:composer.phar

所以我用谷歌搜索了一下并尝试了

So I googled a little and tried

php composer.phar install

但仍然出现相同的错误.所以请指导如何处理这个作曲家以使用 wamp 在 symfony2 中安装新的扩展或包,如数据夹具.

but still getting the same error. So please guide how to deal with this composer to install new extentions or bundles like data-fixtures in symfony2 using wamp.

推荐答案

我在 Windows 上遇到了同样的问题并使用了不同的解决方案.我使用了由 Composer 网站提供的 Composer_Setup.exe 安装文件,它进行了全局安装.

I had the same problem on Windows and used a different solution. I used the Composer_Setup.exe installation file supplied by the composer website and it does a global install.

安装后,请确保您的 PATH 变量指向存储 composer.phar 的目录.这通常是 C:ProgramDataComposerSetupin(ProgramData 可能是一个隐藏目录).不用说,但也要确保 PHP 可执行文件也在您的 PATH 变量中.

After installing, make sure your PATH variable points to the directory where composer.phar is stored. This is usually C:ProgramDataComposerSetupin (ProgramData might be a hidden directory). It goes without saying, but also be sure that the PHP executable is also in your PATH variable.

然后你可以简单地调用

composer install

代替

php composer.phar install

更多推荐

运行 Composer 返回:“无法打开输入文件:composer.phar";

本文发布于:2023-06-04 08:35:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/493351.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法打开   文件   Composer   quot   phar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!