FOS/user-bundle ProxyManager/Configuration错误[英] FOS/user-bundle ProxyManager\Configuration error

本文是小编为大家收集整理的关于FOS/user-bundle ProxyManager/Configuration错误的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

安装Friends friendsofsymfony/用户捆绑包,我遇到此错误

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

也许有想法为什么?

编辑

我使用了此tut

https://symfony.com/doc/master/bundles/FOSUserBundle/index.html

并为用户实体选择"学说ORM用户类"

推荐答案

这是因为您使用了不正确的PHP版本.

这可能是因为您最近更新了PHP版本或更新操作系统.

喜欢 @olukasz D. Tulikowski提到的void是php7.1键作品.

如果您在CLI php -v中检查您可能会得到正确的PHP版本php7.1

最有可能添加代码phpinfo();您会看到PHP版本为7.0.这意味着仍然启用了PHP7.0 mod,您需要用sudo a2dismod php7.0停用该模型(最终启用7.1- sudo a2enmod php7.1 - 但可能不是这样.)

其他推荐答案

这意味着您可能正在使用PHP版本7.0,我遇到了同样的问题,我将其修复了以上版本,然后在thishttps://ayesh.me/ubuntu-php-7.2

本文地址:https://www.itbaoku.cn/post/2090794.html

问题描述

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

Using Symfony3.2 and PHP 7.1

Maybe have ideas why?

EDIT

I used This tut

https://symfony.com/doc/master/bundles/FOSUserBundle/index.html

And choose "Doctrine ORM User class" for user entity

推荐答案

This is because you are using the incorrect php version.

This might happen either because you updated your php version recently or your OS updated it.

Like @Łukasz D. Tulikowski mentioned void is a php7.1 keywork.

If you check in your cli php -v you will get probably the correct php version 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.)

其他推荐答案

This mean maybe you are using php version 7.0, I had the same problem, I fix it removing php previous versions and then reinstall php 7.2 following thishttps://ayesh.me/Ubuntu-PHP-7.2