FOS/用户捆绑ProxyManager \配置错误 [英] FOS/user-bundle ProxyManager\Configuration error
问题描述
在安装friendsofsymfony/user-bundle之后,出现此错误
After installation of friendsofsymfony/user-bundle I getting this error
FatalThrowableError in Configuration.php line 124:
Type error: Return value of ProxyManager\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned
使用Symfony3.2和PHP 7.1
Using Symfony3.2 and PHP 7.1
也许有想法为什么?
编辑
我曾经使用过这个tut
I used This tut
https://symfony.com/doc/master/bundles/FOSUserBundle/index.html
并为用户实体选择"Doctrine ORM用户类别"
And choose "Doctrine ORM User class" for user entity
推荐答案
这是因为使用的PHP版本不正确.
This is because you are using the incorrect php version.
这可能是因为您最近更新了php版本或操作系统更新了它.
This might happen either because you updated your php version recently or your OS updated it.
就像@ŁukaszD. Tulikowski提到的void
是php7.1的键盘输入.
Like @Łukasz D. Tulikowski mentioned void
is a php7.1 keywork.
如果您检查cli php -v
,则可能会获得正确的php版本php7.1
If you check in your cli php -v
you will get probably the correct php version php7.1
如果您添加代码phpinfo();
,很有可能会看到php版本是7.0.这意味着php7.0 mod仍处于启用状态,您需要使用sudo a2dismod php7.0
停用它(并最终启用7.1-sudo a2enmod php7.1
-但这可能不是这种情况.)
Most likely if you add in your code phpinfo();
you will see that the php version is 7.0. This means that the php7.0 mod is still enabled and you need to deactivate that with sudo a2dismod php7.0
(and eventually enable 7.1 - sudo a2enmod php7.1
- but this is probably not the case.)
这篇关于FOS/用户捆绑ProxyManager \配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!