У меня возникла эта проблема некоторое время в разных средах, разных проектах, и иногда я исправлял некоторые другие лайки, и теперь не могу найти причину неудачи, так что это моя последняя попытка.
Я хочу развернуть приложение, следуя правилам документы скажу первое, что я сделал:
composer install --optimize-autoloader
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating optimized autoload files
Updating the "app/config/parameters.yml" file
Clearing the cache for the dev environment with debug true
Trying to install assets as symbolic links.
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
The assets were installed using symbolic links.
Installing assets for Sonata\CoreBundle into web/bundles/sonatacore
The assets were installed using symbolic links.
Installing assets for Sonata\AdminBundle into web/bundles/sonataadmin
The assets were installed using symbolic links.
Installing assets for Nelmio\ApiDocBundle into web/bundles/nelmioapidoc
The assets were installed using symbolic links.
Installing assets for PDI\TemplateBundle into web/bundles/template
The assets were installed using symbolic links.
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
The assets were installed using symbolic links.
Во-вторых, и потому что я не могу обновить библиотеки композитора, я повторно запускаю команду обновления композитора:
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing symfony/symfony (v2.6.9)
- Installing symfony/symfony (v2.7.0)
Downloading: 100%
- Removing sensio/distribution-bundle (v3.0.25)
- Installing sensio/distribution-bundle (v3.0.28)
Downloading: 100%
- Installing yriveiro/php-fslock (0.1)
Downloading: 100%
- Installing jordillonch/deploy-bundle (dev-master 3f8e679)
Cloning 3f8e679eb2ac87d0cef9ea9dd4765afd24c6a266
Writing lock file
Generating autoload files
Updating the "app/config/parameters.yml" file
PHP Deprecated: Symfony\Component\DependencyInjection\Definition::setFactoryMethod(getEntityManager) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. in /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php on line 137
PHP Stack trace:
PHP 1. {main}() /var/www/html/pdone_backend/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /var/www/html/pdone_backend/app/console:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
PHP 4. Symfony\Component\HttpKernel\Kernel->boot() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
PHP 5. Symfony\Component\HttpKernel\Kernel->initializeContainer() /var/www/html/pdone_backend/app/bootstrap.php.cache:2396
PHP 6. Symfony\Component\DependencyInjection\ContainerBuilder->compile() /var/www/html/pdone_backend/app/bootstrap.php.cache:2618
PHP 7. Symfony\Component\DependencyInjection\Compiler\Compiler->compile() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:614
PHP 8. Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:117
PHP 9. Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
PHP 10. Sonata\DoctrineORMAdminBundle\DependencyInjection\SonataDoctrineORMAdminExtension->load() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55
PHP 11. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load() /var/www/html/pdone_backend/vendor/sonata-project/doctrine-orm-admin-bundle/DependencyInjection/SonataDoctrineORMAdminExtension.php:44
PHP 12. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseDefinitions() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:58
PHP 13. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseDefinition() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:119
PHP 14. Symfony\Component\DependencyInjection\Definition->setFactoryMethod() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:153
PHP 15. trigger_error() /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php:137
PHP Deprecated: Symfony\Component\DependencyInjection\Definition::setFactoryService(doctrine) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. in /var/www/html/pdone_backend/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php on line 208
И я получил много предупреждений, но перейти к следующему шагу. Попробуй позвонить по прод. URL (без app_dev.php
) и получил это:
[2015-06-02 09:43:11] request.INFO: Matched route "api_1_post_emails". {"route_parameters":{"_controller":"PDI\\PDOneRestBundle\\Controller\\TargetRestController::postEmailsAction","_format":"json","_route":"api_1_post_emails"},"request_uri":"http://api.dev.pdone.com/api/v1/emails?_format=json"} []
[2015-06-02 09:43:11] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2015-06-02 09:43:11] security.INFO: No expression found; abstaining from voting. [] []
[2015-06-02 09:43:11] php.CRITICAL: Fatal Compile Error: require(): Failed opening required '/var/www/html/pdone_backend/app/cache/prod/doctrine/orm/Proxies/__CG__PDIPDOneBundleEntityTerritory.php' (include_path='.:/usr/share/pear:/usr/share/php') {"type":64,"file":"/var/www/html/pdone_backend/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php","line":209,"level":6143,"stack":[{"function":"getProxyDefinition","type":"->","class":"Doctrine\\Common\\Proxy\\AbstractProxyFactory","file":"/var/www/html/pdone_backend/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php","line":119,"args":[]},{"function":"getProxy","type":"->","class":"Doctrine\\Common\\Proxy\\AbstractProxyFactory","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php","line":2677,"args":[]},{"function":"createEntity","type":"->","class":"Doctrine\\ORM\\UnitOfWork","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php","line":138,"args":[]},{"function":"hydrateRowData","type":"->","class":"Doctrine\\ORM\\Internal\\Hydration\\SimpleObjectHydrator","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php","line":48,"args":[]},{"function":"hydrateAllData","type":"->","class":"Doctrine\\ORM\\Internal\\Hydration\\SimpleObjectHydrator","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php","line":140,"args":[]},{"function":"hydrateAll","type":"->","class":"Doctrine\\ORM\\Internal\\Hydration\\AbstractHydrator","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php","line":756,"args":[]},{"function":"load","type":"->","class":"Doctrine\\ORM\\Persisters\\BasicEntityPersister","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php","line":411,"args":[]},{"function":"find","type":"->","class":"Doctrine\\ORM\\EntityManager","file":"/var/www/html/pdone_backend/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php","line":154,"args":[]},{"function":"find","type":"->","class":"Doctrine\\ORM\\EntityRepository","file":"/var/www/html/pdone_backend/src/PDI/PDOneRestBundle/Controller/TargetRestController.php","line":224,"args":[]},{"function":"postEmailsAction","type":"->","class":"PDI\\PDOneRestBundle\\Controller\\TargetRestController","file":"/var/www/html/pdone_backend/app/bootstrap.php.cache","line":3094,"args":[]},{"function":"call_user_func_array:{/var/www/html/pdone_backend/app/bootstrap.php.cache:3094}","file":"/var/www/html/pdone_backend/app/bootstrap.php.cache","line":3094,"args":[]},{"function":"handleRaw","type":"->","class":"Symfony\\Component\\HttpKernel\\HttpKernel","file":"/var/www/html/pdone_backend/app/bootstrap.php.cache","line":3056,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\HttpKernel\\HttpKernel","file":"/var/www/html/pdone_backend/app/bootstrap.php.cache","line":3207,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel","file":"/var/www/html/pdone_backend/app/bootstrap.php.cache","line":2429,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\HttpKernel\\Kernel","file":"/var/www/html/pdone_backend/web/app.php","line":27,"args":[]},{"function":"{main}","file":"/var/www/html/pdone_backend/web/app.php","line":0,"args":[]}]} []
[2015-06-02 09:43:11] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening required '/var/www/html/pdone_backend/app/cache/prod/doctrine/orm/Proxies/__CG__PDIPDOneBundleEntityTerritory.php' (include_path='.:/usr/share/pear:/usr/share/php')" at /var/www/html/pdone_backend/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 0): Compile Error: require(): Failed opening required '/var/www/html/pdone_backend/app/cache/prod/doctrine/orm/Proxies/__CG__PDIPDOneBundleEntityTerritory.php' (include_path='.:/usr/share/pear:/usr/share/php') at /var/www/html/pdone_backend/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []
Как я могу решить эту проблему? Какова причина этого? У меня есть чистый кэш вручную, я выполняю команды Symfony, я перезагружал веб-сервер (Apache) несколько раз, и, похоже, ничего не помогло. Любой совет?
Похоже, проблема с разрешением (не удалось открыть …), поэтому из каталога проекта выполните
chmod 777 -R app/cache
Других решений пока нет …