DoctrineORMEntityManager的声明:: initializeProxy()必须与ProxyManager \ Proxy \ LazyLoadingInterface :: initializeProxy():bool兼容

问题描述 投票:-1回答:1

当我键入此命令时php app/console assetic:dump --env=prod --no-debug或此php app/console cache:clear --env=prod

我遇到以下错误:

PHP Fatal error:  Declaration of DoctrineORMEntityManager_0000000035a1d9b70000558a7db0d6e7da5c7b8013722216782206eefb5b6fe5::initializeProxy() must be compatible with ProxyManager\Proxy\LazyLoadingInterface::initializeProxy(): bool in /var/www/myproject/app/cache/prod/appProdProjectContainer.php on line 4459

FYI

php --version
PHP 7.2.28 (cli) (built: Feb 18 2020 11:07:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

它曾经在我使用PHP 5时起作用。

php symfony php-7.2 symfony-2.8
1个回答
0
投票

所以我已在评论中说我不再有此错误:我必须手动清空“缓存”目录。所以我做了:rm -rf app/cache/prod/php72 composer.phar dump-autoloadphp72 composer.phar install --optimize-autoloader

而且我得到了一些警告,但到目前为止似乎仍然有效... :) –

© www.soinside.com 2019 - 2024. All rights reserved.