phpsymfonysymfony-2.4invalidargumentexception

Symfony: InvalidArgumentException while parsing web.xml


Recently I moved a Symfony-system to another Server and got an error ever since. The technical details are: An apache 2.4 server on a windows server 2012 A fileserver which can be accessed by apache over the local network

When I moved the Symfony-page I deleted the cache. What happens now is, that 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)

What seems to be the problem, that in the first error, there is a mixture of slashes and backslashes in the path but I have no idea how to fix this issue.


Solution

  • This issue is due to using UNC path (\\something). I had the same problem in Windows network enviroment with IIS and Symfony on another server. Unfortunatelly, I wasn't able to find solution. I ended up with having source code on the same machine and using local path.

    EDIT: I found one more possible solution - symbolic link.

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

    Now you can see under C:\myroot content of shared folder. I don't know if Apache will be happy with it but IIS doesn't have problem. And one more thing, be prepared for some performance issues due to network transfer.