【发布时间】:2016-10-14 16:53:09
【问题描述】:
今天我开始使用 Symfony2 进行一些测试,但我不明白如何安装第 3 方包 friendsofsymfony/user-bundle
我已经安装了一个新的简单项目,名为“prova”
/public_html/prova
/public_html/prova/app
/public_html/prova/vendor
...
我已经安装了作曲家
/var/www/composer.phar
/var/www/public_html
阅读文档我应该使用下载包
./composer.phar require friendsofsymfony/user-bundle
下载所有包
/var/www/vendor
我的问题是 Composer 应该在我的项目 /var/www/public_html/prova/vendor 而不是 composer.phar 的位置上创建这个 /vendor 目录
应该如何在我的项目“Prova”中启用这个包?
更新 将 composer.phar 移到 public_html/prova 项目中并执行“require”命令但抛出此错误
[InvalidArgumentException]
The target directory "web" does not exist.
assets:install [--symlink] [--relative] [-h|--help] [-q|--quiet] [- v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command> [<target>]
Content-type: text/html
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets handling the symfony-scripts event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
An error occurred when executing the "'assets:install --symlink --relative
'\''web'\'''" command:
Content-type: text/html
[InvalidArgumentException]
The target directory "web" does not exist.
assets:install [--symlink] [--relative] [-h|--help] [-q|--quiet] [-v|v
v|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction]
[-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--]
32m<command> [<target>]
.
【问题讨论】:
-
你确定有
web文件夹吗?/var/www/public_html/prova/web?
标签: symfony composer-php