Symfony2 в производственном режиме не работает из-за FOSUserBundle
Я пытаюсь развернуть свой проект symfony2 для университета на своем рабочем сервере. В режиме разработки все работает нормально.
Поэтому я клонировал проект с нашего сервера на мой хостер через git.parameters.yml
прекрасно настроен и composer был в курсе, светильники были загружены в базу данных, а также.
Когда я вызываю папку web
по http symfony2 показывает пустую страницу. prod.log
показывает вкратце следующее:
[2015-11-12 21:16:41] request.CRITICAL: Exception thrown when handling an exception (DoctrineCommonPersistenceMappingMappingException: Invalid mapping file 'FOS.UserBundle.Entity.User.orm.xml' for class 'FOSUserBundleEntityUser'. at /var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php line 86) {"exception":"[object] (Doctrine\Common\Persistence\Mapping\MappingException(code: 0): Invalid mapping file 'FOS.UserBundle.Entity.User.orm.xml' for class 'FOS\UserBundle\Entity\User'. at /var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:86)"} []
[2015-11-12 21:16:41] php.CRITICAL: Uncaught Exception: Invalid mapping file 'FOS.UserBundle.Entity.User.orm.xml' for class 'FOSUserBundleEntityUser'. {"type":1,"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php","line":86,"level":6143,"stack":[{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php","line":117,"function":"invalidMappingFile","class":"Doctrine\Common\Persistence\Mapping\MappingException","type":"::","args":["FOS\UserBundle\Entity\User","FOS.UserBundle.Entity.User.orm.xml"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php","line":58,"function":"getElement","class":"Doctrine\Common\Persistence\Mapping\Driver\FileDriver","type":"->","args":["FOS\UserBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php","line":102,"function":"loadMetadataForClass","class":"Doctrine\ORM\Mapping\Driver\XmlDriver","type":"->","args":["FOS\UserBundle\Entity\User","[object] (Doctrine\ORM\Mapping\ClassMetadata: Doctrine\ORM\Mapping\ClassMetadataInfo@00000000558022090000000071882094)"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php","line":116,"function":"loadMetadataForClass","class":"Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain","type":"->","args":["FOS\UserBundle\Entity\User","[object] (Doctrine\ORM\Mapping\ClassMetadata: Doctrine\ORM\Mapping\ClassMetadataInfo@00000000558022090000000071882094)"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php","line":332,"function":"doLoadMetadata","class":"Doctrine\ORM\Mapping\ClassMetadataFactory","type":"->","args":["[object] (Doctrine\ORM\Mapping\ClassMetadata: Doctrine\ORM\Mapping\ClassMetadataInfo@00000000558022090000000071882094)",null,false,[]]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php","line":216,"function":"loadMetadata","class":"Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory","type":"->","args":["Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php","line":265,"function":"getMetadataFor","class":"Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory","type":"->","args":["Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/orm/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php","line":67,"function":"getClassMetadata","class":"Doctrine\ORM\EntityManager","type":"->","args":["Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/orm/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php","line":50,"function":"createRepository","class":"Doctrine\ORM\Repository\DefaultRepositoryFactory","type":"->","args":["[object] (Doctrine\ORM\EntityManager: {})","Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php","line":665,"function":"getRepository","class":"Doctrine\ORM\Repository\DefaultRepositoryFactory","type":"->","args":["[object] (Doctrine\ORM\EntityManager: {})","Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Doctrine/UserManager.php","line":40,"function":"getRepository","class":"Doctrine\ORM\EntityManager","type":"->","args":["Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/appProdProjectContainer.php","line":835,"function":"__construct","class":"FOS\UserBundle\Doctrine\UserManager","type":"->","args":["[object] (Symfony\Component\Security\Core\Encoder\EncoderFactory: {})","[object] (FOS\UserBundle\Util\Canonicalizer: {})","[object] (FOS\UserBundle\Util\Canonicalizer: {})","[object] (Doctrine\ORM\EntityManager: {})","Hsd\Bundle\ClickerBackendBundle\Entity\User"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2155,"function":"getFosUser_UserManagerService","class":"appProdProjectContainer","type":"->","args":[]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/appProdProjectContainer.php","line":1635,"function":"get","class":"Symfony\Component\DependencyInjection\Container","type":"->","args":["fos_user.user_manager"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2155,"function":"getFosUser_UserProvider_UsernameService","class":"appProdProjectContainer","type":"->","args":[]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/appProdProjectContainer.php","line":1653,"function":"get","class":"Symfony\Component\DependencyInjection\Container","type":"->","args":["fos_user.user_provider.username"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2155,"function":"getSecurity_Authentication_ManagerService","class":"appProdProjectContainer","type":"->","args":[]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/appProdProjectContainer.php","line":1151,"function":"get","class":"Symfony\Component\DependencyInjection\Container","type":"->","args":["security.authentication.manager"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2155,"function":"getSecurity_AuthorizationCheckerService","class":"appProdProjectContainer","type":"->","args":[]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/appProdProjectContainer.php","line":1524,"function":"get","class":"Symfony\Component\DependencyInjection\Container","type":"->","args":["security.authorization_checker",2]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2155,"function":"getTwigService","class":"appProdProjectContainer","type":"->","args":[]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/appProdProjectContainer.php","line":1550,"function":"get","class":"Symfony\Component\DependencyInjection\Container","type":"->","args":["twig"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2155,"function":"getTwig_Controller_ExceptionService","class":"appProdProjectContainer","type":"->","args":[]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/classes.php","line":2934,"function":"get","class":"Symfony\Component\DependencyInjection\Container","type":"->","args":["twig.controller.exception"]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/classes.php","line":2559,"function":"createController","class":"Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver","type":"->","args":["twig.controller.exception:showAction"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":3102,"function":"getController","class":"Symfony\Component\HttpKernel\Controller\ControllerResolver","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":3071,"function":"handleRaw","class":"Symfony\Component\HttpKernel\HttpKernel","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)",2]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":3222,"function":"handle","class":"Symfony\Component\HttpKernel\HttpKernel","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)",2,false]},{"file":"/var/www/virtual/username/symfonyproject/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php","line":50,"function":"handle","class":"Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)",2,false]},{"function":"onKernelException","class":"Symfony\Component\HttpKernel\EventListener\ExceptionListener","type":"->","args":["[object] (Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent: {})","kernel.exception","[object] (Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher: {})"]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/classes.php","line":2272,"function":"call_user_func","args":[["[object] (Symfony\Component\HttpKernel\EventListener\ExceptionListener: {})","onKernelException"],"[object] (Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent: {})","kernel.exception","[object] (Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher: {})"]},{"file":"/var/www/virtual/username/symfonyproject/app/cache/prod/classes.php","line":2201,"function":"doDispatch","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->","args":[[["[object] (JMS\I18nRoutingBundle\EventListener\LocaleChoosingListener: {})","onKernelException"],["[object] (Symfony\Component\HttpKernel\EventListener\ExceptionListener: {})","onKernelException"]],"kernel.exception","[object] (Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent: {})"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":3141,"function":"dispatch","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->","args":["kernel.exception","[object] (Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent: {})"]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":3077,"function":"handleException","class":"Symfony\Component\HttpKernel\HttpKernel","type":"->","args":["[object] (Doctrine\Common\Persistence\Mapping\MappingException(code: 0): Invalid mapping file 'FOS.UserBundle.Entity.User.orm.xml' for class 'FOS\UserBundle\Entity\User'. at /var/www/virtual/username/symfonyproject/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:86)","[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)",1]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":3222,"function":"handle","class":"Symfony\Component\HttpKernel\HttpKernel","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)",1,true]},{"file":"/var/www/virtual/username/symfonyproject/app/bootstrap.php.cache","line":2444,"function":"handle","class":"Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)",1,true]},{"file":"/var/www/virtual/username/symfonyproject/web/app.php","line":28,"function":"handle","class":"Symfony\Component\HttpKernel\Kernel","type":"->","args":["[object] (Symfony\Component\HttpFoundation\Request: GET /de/ HTTP/1.1rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Encoding: gzip, deflaternAccept-Language: de,en-US;q=0.7,en;q=0.3rnAuthorization: rnCache-Control: max-age=0rnConnection: closernCookie: hl=dernHost: dev.mywebsite.dernUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0rnX-Forwarded-For: 91.136.154.136rnX-Forwarded-Port: 80rnX-Forwarded-Proto: httprnX-Php-Ob-Level: 1rnrn)"]}]} []
Что я пытался исправить?
- удалить
app/cache/*
- удалить
vendor/*
и снова запуститьcomposer update
Оба сервера (dev и prod) запускают PHP 5.6.12
Может ли кто-нибудь подсказать мне, что случилось?1 ответ:
"Решение":
Добавьте
libxml_disable_entity_loader(false);
вapp.php
в папкеweb
.
Обходной путь был найден в вопросеgithub .