我正在尝试使用 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)
我该如何解决这个问题?
最佳答案
您可能应该清除 symfony 的缓存,甚至是手动清除,因为它有时会保留对您过去可能在配置文件中设置的资源的引用。对于已删除的翻译 yaml 文件,我遇到了同样的错误,这解决了我的问题。
php app/console cache:clear --no-debug
rm -Rf app/cache/*
rm -RF app/logs/*
您可能需要为这些文件夹设置权限。 Installing and Configuring Symfony 中有说明如何执行此操作的说明.
关于php - 加载 Symfony 2 应用程序时故障排除 "failed to load external entity",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8480299/