【问题标题】:Symfony2 Install Failing- Error 1866 (attribute 'path' is not allowed) / FileLoaderLoadException (Cannot import resource)Symfony2 安装失败 - 错误 1866(不允许属性“路径”)/ FileLoaderLoadException(无法导入资源)
【发布时间】:2016-04-08 06:51:44
【问题描述】:

我正在尝试使用 vagrant 安装预制的开发环境。最后一个组件是 symfony2。控制台抛出错误(如下所示)。关于修复可能是什么的任何想法?我试过用谷歌搜索它们,但没有运气。感谢您提供任何见解!

安装日志:

==> default: 
==> default:                                                                                                                                                                        
==> default:   [Symfony\Component\Config\Exception\FileLoaderLoadException]                                                                                                         
==> default:   Cannot import resource "/srv/wealthbot/vendor/friendsofsymfony/jsrouting-bundle/Resources/config/routing/routing.xml" from "/srv/wealthbot/app/config/routing.yml".  
==> default:                                                                                                                                                                        
==> default: 
==> default:                                                                                                                                                                    
==> default:   [InvalidArgumentException]                                                                                                                                       
==> default:   [ERROR 1866] Element '{http://symfony.com/schema/routing}route', attribute 'path': The attribute 'path' is not allowed. (in /srv/wealthbot/ - line 6, column 0)  
==> default:                                                                                                                                                                    
==> default: 
==> default: cache:warmup [--no-optional-warmers]
==> default: Warming up the cache for the prod environment with debug false
==> default: 

来自 /srv/wealthbot/vendor/friendsofsymfony/jsrouting-bundle/Resources/config/routing/routing.xml 的 routing.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

    <route id="fos_js_routing_js" path="/js/routing.{_format}">
        <default key="_controller">fos_js_routing.controller:indexAction</default>
        <default key="_format">js</default>
        <requirement key="_format">js|json</requirement>
    </route>
</routes>

来自 /srv/wealthbot/app/config/ 的 routing.yml :

# Internal routing configuration to handle ESI
#_internal:
#    resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
#    prefix:   /_internal
fos_user_security:
    resource: "@FOSUserBundle/Resources/config/routing/security.xml"

fos_user_profile:
    resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
    prefix: /profile

fos_user_register:
    resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
    prefix: /register

fos_user_resetting:
    resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
    prefix: /resetting

fos_user_change_password:
    resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
    prefix: /profile

fos_user_group:
    resource: "@FOSUserBundle/Resources/config/routing/group.xml"
    prefix: /group

fos_js_routing:
    resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"

NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc

【问题讨论】:

标签: php symfony composer-php


【解决方案1】:

Symfony 2.1(顺便说一句,很久以前就放弃了支持)没有路由的path 属性。你必须使用pattern 属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-17
    • 2013-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多