Troubleshoot "Failed to load external object" when loading Symfony 2 application

I am trying to start a new project with symfony 2, but I have some problems.

When I go to / web / app _dev.php, I have this error:

  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)

How to solve this problem?

+4
source share
2 answers

You should probably clear symfonyโ€™s cache, even manually, because sometimes it stores links to resources that you could install in your config files in the past. I had the same error for the translation yaml file that was deleted, and this solved my problem.

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

You may need to configure permissions for these folders. There is a note explaining how to do this in Installing and Configuring Symfony .

+1
source

The xsd file cannot be written to disk. Most likely, this is mish-mash backslashes ("\") and inverted ("/") slashes along with file handlers / streams starting with "file: //" and mixing the drive into "C: \" and then things , which are str_replace (), are edited by useless stupidity, like more slashes.

Take a look at your path:

"File: /////INFO/WWW/perso/2011-2012/gdesbiey/Musique/vendor/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd"

Open this in the shell / console and dir yourself until the end of the file path.

0
source

Source: https://habr.com/ru/post/1385967/


All Articles