sonata-project / SonataMediaBundle

Symfony SonataMediaBundle
https://docs.sonata-project.org/projects/SonataMediaBundle
MIT License
452 stars 495 forks source link

[Symfony\Component\Config\Exception\FileLoaderLoadException] #976

Closed taalayuulu closed 6 years ago

taalayuulu commented 8 years ago

An error occurred after installing sonata media bundle

[Symfony\Component\Config\Exception\FileLoaderLoadException]
The file "/home/kanat/Downloads/MainSource/app/config/config.yml" does not contain valid YAML in /home/kanat/Downloads/MainSource/app/config/config.yml (which is being imported from "/home/kanat/Downloads/MainSource/app/config/config_dev.yml").
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The file "/home/kanat/Downloads/MainSource/app/config/config.yml" does not contain valid YAML.
[Symfony\Component\Yaml\Exception\ParseException]
Unable to parse at line 70 (near " entity_managers:").
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
[Symfony\Component\Config\Exception\FileLoaderLoadException]
The file "/home/kanat/Downloads/MainSource/app/config/config.yml" does not contain valid YAML in /home/kanat/Downloads/MainSource/
app/config/config.yml (which is being imported from "/home/kanat/Downloads/MainSource/app/config/config_dev.yml").
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The file "/home/kanat/Downloads/MainSource/app/config/config.yml" does not contain valid YAML.
[Symfony\Component\Yaml\Exception\ParseException]
Unable to parse at line 70 (near " entity_managers:").

my config.yml file

`imports:

parameters: locale: ru

framework:

esi: ~

translator:      { fallbacks: ["%locale%"] }
secret:          "%secret%"
router:
    resource: "%kernel.root_dir%/config/routing.yml"
    strict_requirements: ~
form:            ~
csrf_protection: ~
validation:      { enable_annotations: true }
#serializer:      { enable_annotations: true }
templating:
    engines: ['twig']
    #assets_version: SomeVersionScheme
default_locale:  "%locale%"
trusted_hosts:   ~
trusted_proxies: ~
session:
    # handler_id set to null will use default session handler from php.ini
    handler_id:  ~
fragments:       ~
http_method_override: true

Twig Configuration

twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%"

Assetic Configuration

assetic: debug: "%kernel.debug%" use_controller: false bundles: [ ]

java: /usr/bin/java

filters:
    cssrewrite: ~
    #closure:
    #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
    #yui_css:
    #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

Doctrine Configuration

doctrine: dbal: driver: pdo_mysql host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: UTF8 types: json: Sonata\Doctrine\Types\JsonType

if using pdo_sqlite as your database driver:

    #   1. add the path in parameters.yml
    #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
    #   2. Uncomment database_path in parameters.yml.dist
    #   3. Uncomment next line:
    #     path:     "%database_path%"
orm:
    auto_generate_proxy_classes: "%kernel.debug%"
    naming_strategy: doctrine.orm.naming_strategy.underscore
    auto_mapping: true
     entity_managers:
        default:
            mappings:
                SonataMediaBundle: ~

Swiftmailer Configuration

swiftmailer: transport: "%mailer_transport%" host: "%mailer_host%" username: "%mailer_user%" password: "%mailer_password%" spool: { type: memory }

Admin configuration

sonata_block: default_contexts: [cms] blocks:

enable the SonataAdminBundle block

    sonata.admin.block.admin_list:
        contexts: [admin]
    sonata.admin.block.search_result:
        contexts: [admin]
    sonata.user.block.menu:    # used to display the menu in profile pages
    sonata.user.block.account: # used to display menu option (login option)

sonata_admin: title: Фен templates: show: AdminAdminBundle:Admin:Display_Client.html.twig services: sonata.admin.post: class: Admin\AdminBundle\Admin\PostAdmin tags:

sonata_user: security_acl: true manager_type: orm

FOS userBundle

fos_user: db_driver: orm firewall_name: main user_class: Application\Sonata\UserBundle\Entity\User

group:
    group_class:   Application\Sonata\UserBundle\Entity\Group
    group_manager: sonata.user.orm.group_manager                    # If you're using doctrine orm (use sonata.user.mongodb.user_manager for mongodb)

service:
    user_manager: sonata.user.orm.user_manager

Configuration for media bundle

sonata_media:

if you don't use default namespace configuration

#class:
#    media: MyVendor\MediaBundle\Entity\Media
#    gallery: MyVendor\MediaBundle\Entity\Gallery
#    gallery_has_media: MyVendor\MediaBundle\Entity\GalleryHasMedia
db_driver: doctrine_orm
default_context: default # you need to set a context
contexts:
    default:  # the default context is mandatory
        providers:
            - sonata.media.provider.dailymotion
            - sonata.media.provider.youtube
            - sonata.media.provider.image
            - sonata.media.provider.file
            - sonata.media.provider.vimeo
            image:
                resizer: sonata.media.resizer.square
        formats:
            small: { width: 100 , quality: 70}
            big:   { width: 500 , quality: 70}

cdn:
    server:
                                                                                                                                                                                                                                    path: /uploads/media # http://media.sonata-project.org/

filesystem:
    local:
        directory:  "%kernel.root_dir%/../web/uploads/media"
        create:     false`

the output after composer showe -i

cocur/slugify v1.4.1 Converts a string into a slug. doctrine/annotations v1.2.7 Docblock Annotations Parser doctrine/cache v1.5.4 Caching library offering an object-oriented API for many cache backends doctrine/collections v1.3.0 Collections Abstraction library doctrine/common v2.5.3 Common Library for Doctrine projects doctrine/dbal v2.5.4 Database Abstraction Layer doctrine/doctrine-bundle 1.6.2 Symfony DoctrineBundle doctrine/doctrine-cache-bundle 1.3.0 Symfony Bundle for Doctrine Cache doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules. doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. doctrine/orm v2.4.8 Object-Relational-Mapper for PHP friendsofsymfony/user-bundle v1.3.6 Symfony FOSUserBundle imagine/imagine v0.6.3 Image processing for PHP 5.3 incenteev/composer-parameter-handler v2.1.2 Composer script handling your ignored parameter file jdorn/sql-formatter v1.2.17 a PHP SQL highlighting library jms/metadata 1.5.1 Class/method/property metadata management in PHP jms/parser-lib 1.0.0 A library for easily creating recursive-descent parsers. jms/serializer 0.16.0 Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML. jms/serializer-bundle 0.13.0 Allows you to easily serialize, and deserialize data of any complexity knplabs/gaufrette v0.1.9 PHP5 library that provides a filesystem abstraction layer knplabs/knp-menu v2.1.1 An object oriented menu library knplabs/knp-menu-bundle v2.1.1 This bundle provides an integration of the KnpMenu library kriswallsmith/assetic v1.3.2 Asset Management for PHP kriswallsmith/buzz v0.15 Lightweight HTTP client monolog/monolog 1.18.1 Sends your logs to files, sockets, inboxes, databases and various web services paragonie/random_compat v1.3.0 PHP 5.x polyfill for random_bytes() and randomint() from PHP 7 phpcollection/phpcollection 0.4.0 General-Purpose Collection Library for PHP phpoption/phpoption 1.5.0 Option Type for PHP psr/log 1.0.0 Common interface for logging libraries sensio/distribution-bundle v4.0.5 Base bundle for Symfony Distributions sensio/framework-extra-bundle v3.0.14 This bundle provides a way to configure your controllers with annotations sensio/generator-bundle v2.5.3 This bundle generates code for you sensiolabs/security-checker v3.0.2 A security checker for your composer.lock sonata-project/admin-bundle dev-master 139d110 Symfony SonataAdminBundle sonata-project/block-bundle 2.3.9 Symfony SonataBlockBundle sonata-project/cache 1.0.7 Cache library sonata-project/classification-bundle dev-master d50ec08 Symfony SonataClassificationBundle sonata-project/core-bundle 2.3.10 Symfony SonataCoreBundle sonata-project/datagrid-bundle dev-master 0749e71 Symfony SonataDatagridBundle sonata-project/doctrine-extensions 1.0.2 Doctrine2 behavioral extensions sonata-project/doctrine-orm-admin-bundle dev-master e8eb83f Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle sonata-project/easy-extends-bundle dev-master 36a217b Symfony SonataEasyExtendsBundle sonata-project/exporter 1.4.1 Lightweight Exporter library sonata-project/google-authenticator 1.0.2 Library to integrate Google Authenticator into a PHP project sonata-project/intl-bundle dev-master d49bb81 Symfony SonataIntlBundle sonata-project/media-bundle dev-master fd73a88 Symfony SonataMediaBundle sonata-project/notification-bundle 2.3.3 Symfony SonataNotificationBundle sonata-project/user-bundle dev-master 9c6cde9 Symfony SonataUserBundle swiftmailer/swiftmailer v5.4.1 Swiftmailer, free feature-rich PHP mailer symfony/assetic-bundle v2.8.0 Integrates Assetic into Symfony2 symfony/monolog-bundle v2.10.0 Symfony MonologBundle symfony/phpunit-bridge v2.8.3 Symfony PHPUnit Bridge symfony/polyfill-apcu v1.1.1 Symfony polyfill backporting apcu* functions to lower PHP versions symfony/swiftmailer-bundle v2.3.11 Symfony SwiftmailerBundle symfony/symfony v2.7.10 The Symfony PHP framework twig/extensions v1.3.0 Common additional features for Twig that do not directly belong in core twig/twig v1.24.0 Twig, the flexible, fast, and secure template language for PHP zendframework/zenddiagnostics v1.0.8 A set of components for performing diagnostic tests in PHP applications

please help .

Avtonom commented 8 years ago

@taalayuulu We solved the problem?

core23 commented 8 years ago

Please read the error message!

The file "/home/kanat/Downloads/MainSource/app/config/config.yml" does not contain valid YAML.

This is not related to any sonata package. Please use stack overflow for general questions.