简体   繁体   English

Symfony 4 install没有“ public”文件夹。只有“ vendor /”。(无法打开输入文件:bin / console)

[英]Symfony 4 install there is no “public” folder.Just “vendor/”.(Could not open input file: bin/console)

I want to learn Symfony Framework but i can't run it.Composer latest version.And i use this command to install framework as Docs said.Than i use this command for start the server in "project/" folder but i get that error "Could not open input file: bin/console" . 我想学习Symfony Framework,但是我无法运行它。Composer最新版本。我使用此命令按照Docs的说明安装框架。比我使用此命令在“ project /”文件夹中启动服务器,但出现错误"Could not open input file: bin/console"

duhan@dbalci:/var/www$ composer create-project symfony/skeleton project


Installing symfony/skeleton (v4.0.5)
  - Installing symfony/skeleton (v4.0.5): Loading from cache
Created project in project
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 21 installs, 0 updates, 0 removals
  - Installing symfony/flex (v1.0.78): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.7.0): Loading from cache
  - Installing symfony/console (v4.0.8): Loading from cache
  - Installing symfony/routing (v4.0.8): Loading from cache
  - Installing symfony/http-foundation (v4.0.8): Loading from cache
  - Installing symfony/yaml (v4.0.8): Loading from cache
  - Installing symfony/framework-bundle (v4.0.8): Loading from cache
  - Installing symfony/http-kernel (v4.0.8): Loading from cache
  - Installing symfony/event-dispatcher (v4.0.8): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing symfony/debug (v4.0.8): Loading from cache
  - Installing symfony/finder (v4.0.8): Loading from cache
  - Installing symfony/filesystem (v4.0.8): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/dependency-injection (v4.0.8): Loading from cache
  - Installing symfony/config (v4.0.8): Loading from cache
  - Installing psr/simple-cache (1.0.1): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing symfony/cache (v4.0.8): Loading from cache
  - Installing symfony/dotenv (v4.0.8): Loading from cache
Writing lock file
Generating autoload files

duhan@dbalci:/var/www$ cd project/
duhan@dbalci:/var/www/project$ php bin/console server:run
Could not open input file: bin/console

There is just "vendor/" folder but i seen in tutorials there is more. 只有“ vendor /”文件夹,但我在教程中看到的更多。
"ls -l" output : “ ls -l”输出:

duhan@dbalci:/var/www/project$ ls -l
total 60
-rw-rw-r-- 1 duhan duhan  1231 Apr 13 13:30 composer.json
-rw-rw-r-- 1 duhan duhan 48230 Apr 13 13:30 composer.lock
-rw-rw-r-- 1 duhan duhan     3 Apr 13 13:30 symfony.lock
drwxrwxr-x 5 duhan duhan  4096 Apr 13 13:30 vendor

It seems like Composer hasn't fully executed the functionality in the symfony/flex plugin. 似乎Composer尚未完全执行symfony / flex插件中的功能。 The only reason I can think of that would cause this is if you've got plugins disabled globally (you can diagnose this by running composer config -l and seeing if it mentions no-plugins anywhere) 我能想到的唯一原因是,如果您全局禁用了插件(您可以通过运行composer config -l并查看它是否在任何地方都提到了no-plugins来进行诊断)

I can replicate your directory structure by running: 我可以通过运行以下命令来复制您的目录结构:

composer create-project symfony/skeleton project --no-plugins
cd project
composer install

This will create an empty symfony.lock file, but not unpack any of the installed Symfony recipes. 这将创建一个空的symfony.lock文件,但不会解压缩任何已安装的Symfony配方。

From here, you should be able to complete the installation by running 从这里,您应该可以通过运行以下命令完成安装

composer fix-recipes

in the project folder. 在项目文件夹中。 This will finish unpacking all of the installed recipes, including creating the missing directory structure. 这将完成所有已安装配方的解压缩,包括创建缺少的目录结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM