Symfony runs correctly but I get this error after I open in browser All my controller is empty Response
FatalThrowableError
Type error: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned
Here is my config file, I use multiple database
# Doctrine Configuration
doctrine:
dbal:
default_connection: admin
connections:
admin:
driver: pdo_mysql
host: '%database_host%'
port: '%database_port%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'
charset: UTF8
public_branch:
driver: pdo_mysql
host: '%database_host1%'
port: '%database_port1%'
dbname: '%database_name1%'
user: '%database_user1%'
password: '%database_password1%'
charset: UTF8
orm:
auto_generate_proxy_classes: '%kernel.debug%'
default_entity_manager: admin
entity_managers:
admin:
connection: admin
auto_mapping: true
public_branch:
connection: public_branch
mappings:
AdminBundle: ~
PublicBranchBundle: ~
What can I do?
What the problem fixed for me was, after upgrading to PHP 7.1, also enable PHP 7.1 for apache2 by
I also had to disable PHP 7.0 for some reason:
I solved this problem by updating my php from 7.0 to 7.1 , using the following commands:
If some still facing same problem either move to php 7.1 or simply do
it will automatically downgrade doctrine/annotations from 1.5 to 1.4 which work with php < 7.1
Unfortunately not every prod server can be upgraded that simply.
Recent Doctrine updates require PHP 7.1..
You can downgrade ORM to 2.5 and necessarily Annotations to 1.4:
This way you can still use PHP 7.0.