Symfony $ id必须是字符串Exception

时间:2017-08-28 11:48:14

标签: php symfony xampp swiftmailer

您好我最近安装了Symfony,当我运行我的网址时出现此错误,我尝试在网上查看,但对于我的生活,我无法找到解决方案,为什么会发生这种情况。请帮助:(

  

致命错误:未捕获的异常'Symfony \ Component \ DependencyInjection \ Exception \ InvalidArgumentException',消息'$ id必须是字符串或Alias对象。在D:\ PersonalProject \ auctionbackend \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ContainerBuilder.php:662堆栈跟踪:#0 D:\ PersonalProject \ auctionbackend \ vendor \ symfony \ swiftmailer-bundle \ DependencyInjection \ SwiftmailerExtension .php(223):Symfony \ Component \ DependencyInjection \ ContainerBuilder-> setAlias('swiftmailer.mai ...',21)#1 D:\ PersonalProject \ auctionbackend \ vendor \ symfony \ swiftmailer-bundle \ DependencyInjection \ SwiftmailerExtension。 php(92):Symfony \ Bundle \ SwiftmailerBundle \ DependencyInjection \ SwiftmailerExtension-> configureMailerSpool('default',Array,Object(Symfony \ Component \ DependencyInjection \ ContainerBuilder),21,true)#2 D:\ PersonalProject \ auctionbackend \ vendor \ symfony \ swiftmailer-bundle \ DependencyInjection \ SwiftmailerExtension.php(53):Symfony \ Bundle \ SwiftmailerBundle \ DependencyInjection \ SwiftmailerExtension-> configureMailer in D:\ PersonalProject \ auctionbackend \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ContainerBuilde第662行的r.php

配置

 swiftmailer:
    transport:  "%mailer_transport%"
    host:       "%mailer_host%"
    port:       "993"
    username:   "%mailer_user%"
    password:   "%mailer_password%"
    port:       "%mailer_port%"
    encryption: "ssl"
    password:   "%mailer_password%"
    spool:      { type: memory }

fos_user:
    db_driver: orm
    firewall_name: main
    user_class: TopNode\SupportBundle\Entity\User
    from_email:
        address:      support@top-node.com
        sender_name:  Support

stof_doctrine_extensions:
    default_locale: en_US
    orm:
        default:
            timestampable: true
            blameable: true
            sluggable: true

knp_paginator:
    page_range: 5                      # default page range used in pagination control
    default_options:
        page_name: page                # page query parameter name
        sort_field_name: sort          # sort field query parameter name
        sort_direction_name: direction # sort direction query parameter name
        distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
    template:
        pagination: SupportBundle:Default:pagination.html.twig     # sliding pagination controls template
        sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template
services:
    twig.extension.text:
        class: Twig_Extensions_Extension_Text
        tags:
            - { name: twig.extension }
    salavert.twig.time_ago:
        class: Salavert\Twig\Extension\TimeAgoExtension
        arguments: [@translator]
        tags:
        - { name: twig.extension }

更新

下面的脚本中的InstallAssets cmd似乎失败了

作曲家文件

 "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
        ]

详细错误

in ContainerBuilder.php line 662
at ContainerBuilder->setAlias('swiftmailer.mailer.default.transport.real', '25') in SwiftmailerExtension.php line 223
at SwiftmailerExtension->configureMailerSpool('default', array('transport' => '25', 'host' => '127.0.0.1', 'port' => '993', 'username' => 'test@test.com', 'password' => '2382752398', 'encryption' => 'ssl', 'spool' => array('type' => 'memory', 'path' => '%kernel.cache_dir%/swiftmailer/spool', 'id' => null), 'timeout' => '30', 'source_ip' => null, 'auth_mode' => null, 'logging' => true, 'delivery_whitelist' => array()), object(ContainerBuilder), '25', true) in SwiftmailerExtension.php line 92
at SwiftmailerExtension->configureMailer('default', array('transport' => '25', 'host' => '127.0.0.1', 'port' => '993', 'username' => 'test@test', 'password' => '852359', 'encryption' => 'ssl', 'spool' => array('type' => 'memory', 'path' => '%kernel.cache_dir%/swiftmailer/spool', 'id' => null), 'timeout' => '30', 'source_ip' => null, 'auth_mode' => null, 'logging' => true, 'delivery_whitelist' => array()), object(ContainerBuilder), true) in SwiftmailerExtension.php line 53
at SwiftmailerExtension->load(array(array('transport' => '25', 'host' => '127.0.0.1', 'port' => '993', 'username' => 'test@test.com', 'password' => '8235259', 'encryption' => 'ssl', 'spool' => array('type' => 'memory'))), object(ContainerBuilder)) in MergeExtensionConfigurationPass.php line 59
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in Compiler.php line 104
at Compiler->compile(object(ContainerBuilder)) in ContainerBuilder.php line 598
at ContainerBuilder->compile() in bootstrap.php.cache line 2754
at Kernel->initializeContainer() in AppKernel.php line 43
at AppKernel->initializeContainer() in bootstrap.php.cache line 2529
at Kernel->boot() in bootstrap.php.cache line 2560
at Kernel->handle(object(Request)) in index.php line 29

0 个答案:

没有答案