Symfony: InvalidArgumentException while parsing web.xml

I recently moved the Symfony system to another server and have since received an error. Technical details: Apache 2.4 server on a Windows 2012 server File server access to which through apache through a local network

When I moved the Symfony page, I deleted the cache. What happens now, I get these error messages:

InvalidArgumentException: Unable to parse file "\\FILESERVER\PAGEPATH\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection/../Resources/config\web.xml". 

and

 InvalidArgumentException: [WARNING 1549] failed to load external entity "file://///FILESERVER/PAGEPATH/vendor/symfony/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://///FILESERVER/PAGEPATH/vendor/symfony/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 //FILESERVER/PAGEPATH/web/ - line 5, column 0) 

It seems that the problem is that with the first error on the way there is a mixture of slashes and backslashes, but I don't know how to fix this problem.

+7
php symfony
source share
3 answers

This issue is related to using the UNC path (\\ something). I had the same problem in a Windows network environment with IIS and Symfony on a different server. Unfortunately, I could not find a solution. I ended up with the source code on the same computer and using the local path.

EDIT : I found another possible solution - a symlink.

 mklink /d C:\myroot \\FILESERVER\PAGEPATH 

Now you can see the contents of C: \ myroot in the shared folder. I don't know if Apache will like it, but IIS has no problem. And one more thing, be prepared for some performance issues due to network transmission.

+2
source share

I'm not sure if this is related to your problem, but I once had problems parsing XML files when the schema definition file could not be loaded during parsing. The parser tried to download the XML schema file over the network, and in the event of a network connection failure, the analysis of the XML file also failed.

If you are in production, for performance reasons, you may not need to validate the circuit at all, so check to see if the parser you are using is used to disable automatic circuit validation. However, if an error occurs in your development workflow, make sure that the URLs of the schema can actually be resolved from a web server that parses the XML file.

+1
source share

If the UNC path is a problem, it may work if you map a network share to a local drive and use the paths on the local drive to access the application.

Map \\FILESERVER\PAGEPATH to the local drive, say W: ( W from web ), then configure the Apache web root to W:\web instead of \\FILESERVER\PAGEPATH\web . I believe all other path references are relative, and nothing else needs to be changed.

(just a thought)

Update:

As a regular user, you can map a network resource as a local disk and automatically connect it to each input using the following command line:

 C:\> net use W: \\FILESERVER\PAGEPATH /persistent:yes 

Apache does not work as a regular user (I do not have a Windows operating system, but I think it works like SYSTEM USER ). I can’t say if special users start when Windows starts.

However, I think that you can run the command above (saved in the .cmd file) using Task Scheduler (on Windows 7 or later) every time you start Windows.

0
source share

All Articles