Symfony2安装失败 - 错误1866(不允许属性'path')/ FileLoaderLoadException(无法导入资源)

时间:2016-04-08 06:51:44

标签: php symfony composer-php

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

安装日志

with open(filename, 'r') as f:
    l = map(lambda x: map(int, x.split()), f.readlines())

    for n in range(len(l[0])):
        list_of_speed = [value[n] for value in l]
        max_speed = max(list_of_speed)
        aver_speed = float(sum(list_of_speed))/len(list_of_speed)

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

==> 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 / app / config /的routing.yml:

<?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>

1 个答案:

答案 0 :(得分:0)

Symfony 2.1(很久以前就失去了支持)没有路由的path属性。您必须使用pattern属性。