simplexml_load_file():I/O警告:无法加载外部实体" /user-bundle/Resources/config/doctrine/model/User.orm.xml

PyR*_*Man 11 php libxml2 symfony doctrine-orm

我的Symfony2的生产部署存在一些问题,

我尝试了很多解决方案,但都没有.

在生产环境中访问我的symfony应用程序时,我随机出现此错误:

( ! )   Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Warning: simplexml_load_file(): I/O warning : failed to load external entity    "/home/user/symfony/vendor/friendsofsymfony/user-bundle/Resources/config/doctrine/model/User.orm.xml"'    in /home/user/symfony/app/bootstrap.php.cache on line 2998
( ! )   Symfony\Component\Debug\Exception\ContextErrorException: Warning: simplexml_load_file():    I/O warning : failed to load external entity    "/home/user/symfony/vendor/friendsofsymfony/user-bundle/Resources/config/doctrine/model/User.orm.xml" in /home/user/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php on line 736
Call Stack
#   Time    Memory  Function    Location
1   0.0000  262880  {main}( )   ../app_dev.php:0
2   0.0015  572736  Symfony\Component\HttpKernel\Kernel->handle( )  ../app_dev.php:79
3   0.1342  4023952 Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle( )    ../bootstrap.php.cache:2376
( ! )   LogicException: Request stack is empty  in /home/user/symfony/app/bootstrap.php.cache on line 2998
Call Stack
#   Time    Memory  Function    Location
1   0.3330  7110120 Symfony\Component\Debug\ErrorHandler->handleException( )    ../classes.php:0
2   0.3331  7119696 Symfony\Component\Debug\ErrorHandler->handleException( )    ../classes.php:1939
Run Code Online (Sandbox Code Playgroud)

我试图升级我的php版本(我在PHP 5.4.x中,现在在5.6.4中),

我试过升级lixml2版本(我现在在2.8.0,但我已经尝试升级2.9.3)

我constated是的libxml的在PHP中使用的版本是2.8.0永远,但我还没有找到改变这种方式,

我试图在chmod 777中设置symfony的所有目录

我的服务器是debian 7.5服务器.

也许知道这个错误的人可以帮助我

以下是与此相关的不同问题的一些链接:

随机错误,FOSUserBundle错误服务错误

我没有发帖,因为他们都过时了

[编辑]

我发现了一个速战速决,但它的供应商,所以它会在学说更新的第一次更新来overrided:

XmlDriver.php第737行中的QuickFix

$xmlElement = @simplexml_load_file($file);
if(!$xmlElement){
        $xmlData = file_get_contents($file);
        $xmlElement = simplexml_load_string($xmlData);
}
Run Code Online (Sandbox Code Playgroud)