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

php的作曲家。phar更新

但我发现了一个错误:

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

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

php composer.phar install

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


当前回答

如果你使用的是Ubuntu/Linux并且你正在尝试运行

php的作曲家。Phar需要在命令行上进行干预/图像。

使用sudo composer require intervention/image代替。这会给你想要的东西。

其他回答

这招对我很管用:

composer install

没有

php composer install

我发现这工作,因为我没有卷曲安装。在Windows 8上安装XAMPP。它会将它添加到您的本地构建,我使用.gitignore来避免回购

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

我在这里找到了:https://getcomposer.org/download/

朋友们,请按照以下步骤在MAC OS中修复此问题

Step 1: first run the command in Terminal with your project directory $ curl -sS https://getcomposer.org/installer | php Step 2: Move the composer.phar in your project directory $ mv composer.phar /Applications/MAMP/htdocs/bashrushAPI/composer.phar Step 3: Setup alias the composer $ alias composer='/Applications/MAMP/htdocs/bashrushAPI/composer.phar' Step 4: Check the composer version now $ composer --version Composer version 1.7.2 2018-08-16 16:57:12 Step 5: Confirm the project folders and file placed on bellow $ ls CONTRIBUTING.md docker-compose.yml templates README.md logs tests composer.json phpunit.xml vendor composer.lock public composer.phar src Step 6: Now update composer $ composer.phar update Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files Step 7: Run your sample project $ php composer.phar start php -S localhost:8080 -t public [Thu Sep 27 03:16:11 2018] ::1:51177 [200]: / [Thu Sep 27 03:16:11 2018] ::1:51178 [404]: /favicon.ico - No such file or directory

我也有同样的问题。当我使composer全局可用时,这个问题就解决了。现在我可以从文件夹中的任何地方屯命令。

作曲家更新

作曲家需要“samplelibraryyouwant”

只需以管理员身份打开cmd,进入您的项目文件夹,并使用composer命令检查它是否工作。

上述错误是由于编写器不能全局访问。 因此,您需要以管理员身份运行“cmd”。

这对我来说很有效。