Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
525 views
in Technique[技术] by (71.8m points)

php - New Symfony 3 installation: Could not open input file: app/console in composer install

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?

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.

Any tips?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just create var directory. After that composer install and composer update will work ok.

Explanation:

vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:462

protected static function useNewDirectoryStructure(array $options)
{
    return isset($options['symfony-var-dir']) && is_dir($options['symfony-var-dir']);
}

So you need both to have symfony-var-dir in composer.json's extra and have this directory existing.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...