新的 Symfony 3 安装:无法打开输入文件:composer 安装中的 app/console [英] New Symfony 3 installation: Could not open input file: app/console in composer install
问题描述
我通过官方 symfony-installer (http://symfony.com/download).做完第一件事后,我将项目提交到 Git 并在前几天将其克隆到另一台计算机上.克隆后,我运行composer install"来安装所有的 symfony 依赖项.现在问题来了:脚本 ScriptHandler::clearCache
因错误而停止:无法打开输入文件:app/console
.没错 - symfony3 有一个新的目录结构 - 所以 console
现在位于 /bin
- 而不是 /app
.我如何告诉作曲家/项目使用新结构而不是旧结构?
I installed a fresh symfony3-instance via the official symfony-installer (http://symfony.com/download). After doing the first things, I commited the project to Git and cloned it the other day on another computer.
After the cloning I ran "composer install" to install all the symfony-dependencies.
Now comes the problem: The script ScriptHandler::clearCache
stops with an error: Could not open input file: app/console
.
Thats right - symfony3 has a new directory-structure - so the console
resides now in /bin
- not in /app
.
How can I tell composer/the project to use the new structure instead of the old one?
我在这里阅读(什么是新的 Symfony 3 目录结构?) 关于控制台命令 SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE=true
- 但这在我的情况下不起作用.
I read here (What is the new Symfony 3 directory structure?) about the console-command SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE=true
- but that doesn't work in my case.
有什么建议吗?
推荐答案
ScriptHandler
从 composer.json
文件名中的额外配置键中获取目录为 <代码>symfony-bin-dir.因此请检查 Composer 是否包含正确的配置密钥,例如:
The ScriptHandler
take the dir from the extra config key in the composer.json
files names as symfony-bin-dir
. So check that the composer contain the correct configuration key, as example:
composer.json
....
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
....
问题与composer的缓存有关.使用以下命令清除它已解决:
The problem was related to the cache of composer. It was solved clearing it with the command:
>php composer.phar clear-cache
希望这会有所帮助.
这篇关于新的 Symfony 3 安装:无法打开输入文件:composer 安装中的 app/console的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!