2

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
    Please describe the exact steps you took. It looks like a configuration issue, so maybe post your config.yml (at least the changes you made when installing the bundle), the user entity you created. Right now we won't be able to help you other than you return a null instead of the expected type when specifying the generator strategy (probably for the id). – dbrumann Apr 09 '17 at 09:11
  • 1
    What case your issue is fact that `void` is a php7.1 keyword. https://wiki.php.net/rfc/void_return_type. – Łukasz D. Tulikowski Apr 09 '17 at 21:34

2 Answers2

3

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

Herr Nentu'
  • 1,438
  • 3
  • 18
  • 49
0

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

tovaz
  • 193
  • 1
  • 2
  • 8