我是symfony2和symblog的新手。在第三章中,当我尝试使用数据fixture时,我尝试了命令:

php的作曲家。phar更新

但我发现了一个错误:

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

所以我谷歌了一下,试了试

php composer.phar install

但还是得到相同的错误。因此,请指导如何使用wamp在symfony2中安装新的扩展或数据fixture之类的编写器。


当前回答

如果你想创造作曲家。Phar文件在任何文件夹遵循此命令。

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

php -r "if (hash_file('sha384', 'composer-setup.php') === 'c5b9b6d368201a9db6f74e2611495f369991b72d9c8cbd3ffbc63edff210eb73d46ffbfce88669ad33695ef77dc76976') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php

php -r "unlink('composer-setup.php');"

其他回答

我用的是windows 8.0。在我的情况下,安装或更新我只是使用composer install或其他东西,而不是php composer.phar。这对我很有效 就像

composer require google/apiclient:1.*

你可以这样做

curl -sS https://getcomposer.org/installer | php

-sS标志表示不显示进度,只显示错误

然后

php composer.phar install

来自: 如何让cURL不显示进度条?

https://packagist.org/

如果你已经安装了Composer,你可以试试这个命令:

composer update 

或者如果你想添加一些bundle到你的作曲家尝试这个:

composer require "/../"

在使用以下命令之前,我一直面临同样的问题。

composer self-update

希望这也适用于你!

如果没有,你可以在这里查看整个版本 https://blog.packagist.com/composer-2-0-is-now-available/

用这个:

php -r "readfile('https://getcomposer.org/installer');" | php