FOS/user-bundle ProxyManager\Configuration error

大城市里の小女人 提交于 2019-12-07 23:01:38

问题


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


回答1:


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.)




回答2:


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



来源:https://stackoverflow.com/questions/43304889/fos-user-bundle-proxymanager-configuration-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!