Symfony:解析web.xml时,InvalidArgumentException [英] Symfony: InvalidArgumentException while parsing web.xml

查看:102
本文介绍了Symfony:解析web.xml时,InvalidArgumentException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我将Symfony系统移动到另一台服务器,此后一直出现错误. 技术细节是: Windows Server 2012上的Apache 2.4服务器 可以通过本地网络通过apache访问的文件服务器

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

当我移动Symfony页面时,我删除了缓存. 现在发生的是,我得到了以下错误消息:

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".

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.

推荐答案

此问题是由于使用UNC路径(\\ something)引起的.我在Windows网络环境中的另一台服务器上使用IIS和Symfony遇到了相同的问题.不幸的是,我无法找到解决方案.最后,我在同一台计算机上使用了本地代码并使用了本地路径.

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

现在,您可以在C:\ myroot下看到共享文件夹的内容.我不知道Apache是​​否会对它满意,但是IIS没问题.还有一件事,要为由于网络传输而导致的一些性能问题做好准备.

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.

这篇关于Symfony:解析web.xml时,InvalidArgumentException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆