我是symfony2和symblog的新手。在第三章中,当我尝试使用数据fixture时,我尝试了命令:
php的作曲家。phar更新
但我发现了一个错误:
无法打开输入文件:composer.phar
所以我谷歌了一下,试了试
php composer.phar install
但还是得到相同的错误。因此,请指导如何使用wamp在symfony2中安装新的扩展或数据fixture之类的编写器。
我是symfony2和symblog的新手。在第三章中,当我尝试使用数据fixture时,我尝试了命令:
php的作曲家。phar更新
但我发现了一个错误:
无法打开输入文件:composer.phar
所以我谷歌了一下,试了试
php composer.phar install
但还是得到相同的错误。因此,请指导如何使用wamp在symfony2中安装新的扩展或数据fixture之类的编写器。
当前回答
朋友们,请按照以下步骤在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
其他回答
用这个:
php -r "readfile('https://getcomposer.org/installer');" | php
你的作曲家。phar必须在源文件中。我也有同样的问题,我只是剪掉了我的作曲家。Phar到我的框架标准版文件夹,那里是我的整个强文本项目。
与我的工作,你只需要文件编写器。Phar和作曲家。Json在当前项目中。 命令为
php composer.phar update
对于windows,我创建了composer。CMD并使用下面的文本:
php c:\programs\php\composer.phar %*
作曲家。Phar被安装,c:\programs\php\被添加到我的路径中。
不知道为什么这不是自动完成的。
我已经修复了以下步骤相同的问题
打开项目目录Using Terminal(您正在使用的终端,即mintty) 现在按照https://getcomposer.org/download/上给出的说明在这个目录中安装composer
PHP -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === 'the-provided-hash-code') {echo '已验证安装程序';} else {echo '安装程序损坏';分离(“composer-setup.php”);} echo PHP_EOL;" php composer-setup.php PHP -r "unlink('composer-setup.php');"
现在执行你的命令。
现在一切都很顺利,因为作曲家。Phar文件在当前项目目录中可用。
谢谢