首页 文章

加载Symfony 2应用程序时,“无法加载外部实体”进行故障排除

提问于
浏览
4

我正在尝试用symfony 2开始一个新项目,但我遇到了一些问题 .

当我要去/web/app_dev.php我有这个错误:

InvalidArgumentException: [WARNING 1549] failed to load external entity 
"file://///INFO/WWW/perso/2011-2012/gdesbiey/Musique/vendor/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd" 
(in n/a - line 0, column 0)
[WARNING 3084] Element '{http://www.w3.org/2001/XMLSchema}import': 
Failed to locate a schema at location 
'file://///INFO/WWW/perso/2011-2012/gdesbiey/Musique/vendor/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd'. 
Skipping the import. (in in_memory_buffer - line 8, column 0)
[ERROR 1845] Element '{http://symfony.com/schema/dic/services}container': 
No matching global declaration available for the validation root. (in //INFO/WWW/perso/2011-2012/gdesbiey/Musique/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml - line 5, column 0)

我该如何解决这个问题?

2 回答

  • 1

    您可能应该清除symfony的缓存,甚至是手动缓存,因为它有时会引用您过去在配置文件中设置的资源 . 对于已被删除的翻译yaml文件,我遇到了同样的错误,这解决了我的问题 .

    php app/console cache:clear --no-debug
    
    rm -Rf app/cache/*
    rm -RF app/logs/*
    

    你'll may have to set up permissions on these folders. There'是一个解释如何在Installing and Configuring Symfony中做到这一点的说明 .

  • 0

    xsd文件无法写入磁盘..它可能是向后(“\”)和向前(“/”)斜杠以及以“file://”开头并混合驱动器的文件处理程序/流的斜杠在“C:\”中然后是str_replace()的东西,用无用的废话就像更多的斜杠 .

    看看你的路径:

    “文件://///INFO/WWW/perso/2011-2012/gdesbiey/Musique/vendor/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd”

    在shell / console中打开它,然后自己 dir 到文件路径的末尾 .

相关问题